On this page
What this issue is
Address validation rejects other countries when a field's rule assumes one format. Common examples: a postcode field that accepts only five digits, a field that demands a state or province for every country, a field that rejects letters or spaces, or a rule that caps length at 5 or 6 characters.
Postal codes vary a lot. UK codes look like SW1A 1AA, Canadian ones like K1A 0B1, Dutch ones like 1012 AB, and some countries (for example Ireland outside Eircode areas, or Hong Kong) have no postcode in common use. One pattern cannot fit them all.
| Country | Example | Why a 5-digit rule fails |
|---|---|---|
| United Kingdom | SW1A 1AA | Letters, a space, 6-7 characters |
| Canada | K1A 0B1 | Letters and digits alternate |
| Netherlands | 1012 AB | 4 digits plus 2 letters |
| Ireland | D02 X285 | Eircode with letters and a space |
| Germany | 10115 | Passes, so a bug can hide in testing |
| Hong Kong | (none) | Field required but no code exists |
Why it costs you leads or sales
The visitor wants to buy or enquire, types a correct address and gets an error. Most will not guess a workaround. Some will invent a fake ZIP to get through, which gives you bad data and failed deliveries. Others leave. Because the error is shown only to people in certain countries, your own tests from home rarely catch it, and your analytics just show a drop at the address step.
- Ad or search clickVisitor from the UK or Canada
- Fills the formEnters a valid local postcode
- Postcode checkRule expects 5 digits and rejects it
- Submission or paymentNever reached
- Conversion trackingNo event sent
The postcode rule fails the step, so later steps never happen.
Example: illustrative numbers showing how a US-only rule can hurt other countries. Not real data.
How to check if your site has it
Test the form as a visitor from each country you sell to or advertise in. You do not need a VPN for this: the rule runs in the page, so choosing a different country in the dropdown is enough. If there is no country field, that alone is a warning sign.
- UK: SW1A 1AA (with the space) and SW1A1AA (without)
- Canada: K1A 0B1
- Ireland: D02 X285
- Netherlands: 1012 AB
- A country with no postcode, such as Hong Kong or the UAE: leave the field blank
- A country where state is not used: leave state blank
- Check the error message wording and whether the submit button stays disabled
Also open your browser's developer tools (Network and Console tabs) while submitting. A validation message from your server or a payment provider shows up as a failed request, which tells you whether the rule is in the page, the plugin or the backend.
How to fix it
Find where the rule lives
It may be a form plugin setting, a theme or checkout setting, a custom regex in JavaScript, a hidden pattern attribute, or backend code. Search your code for
pattern=,\d{5}or[0-9]{5}.Add a country field first
Validation can only be correct if you know the country. Put the country selector before the postcode and state fields.
Validate by selected country
Apply a pattern per country, or use a maintained library or service instead of writing your own. For countries you do not list, accept any non-empty value.
Make postcode and state optional where not used
Only require state or province for countries that use it. Do not require a postcode for countries without one.
Allow spaces and letters, and normalise
Trim spaces, allow letters, digits, spaces and hyphens, and uppercase the value on save rather than rejecting the visitor.
Write a helpful error message
Say what format is expected for the chosen country, for example 'Enter a UK postcode like SW1A 1AA'.
Form plugins
In your form plugin, open the postcode field and remove any custom validation, regex or input mask that limits it to digits. Use a plain text field, or a country-specific rule driven by the country field.
WooCommerce
Under WooCommerce > Settings > General, check 'Selling location(s)' and 'Shipping location(s)' include your target countries. WooCommerce validates postcodes per country; if checkout still rejects valid codes, disable plugins that add checkout field rules one at a time to find the culprit.
Markets and shipping
Shopify validates addresses by country in its own checkout. Under Settings > Markets (or Shipping and delivery), make sure the country is enabled for selling.
Custom forms
If a theme form or app collects addresses, check the theme code or app settings for a hard-coded postcode pattern and remove or make it country-specific.
Check injected scripts
In Tags, look for Custom HTML tags that add validation to form fields. Edit or pause the tag, then test in Preview mode.
Form field settings
Webflow's native text fields do not enforce a postcode format. If a rule is blocking people, look in Project settings > Custom code and the page's embed elements for a validation script, and edit it.
Form builder
Open the form in Sites > Forms, select the address or postal code field and check its type and any required toggle. Use a plain text field for postcode and a country dropdown, and make state optional.
Form and Velo
In the form's field settings, change the postcode field to short text and untick Required if the country has no postcode. If you use Velo code, search for a regex on the field and make it depend on the country.
Form blocks and code injection
Use a Text field for postcode in the form block. If rejection persists, check Settings > Advanced > Code Injection for a script adding validation.
Replace the global pattern
Remove fixed
patternattributes and use a country-keyed map in your validation code, plus the same check on the server (see the code example below).
const postcodePatterns = {
US: /^\d{5}(-\d{4})?$/,
GB: /^[A-Z]{1,2}\d[A-Z\d]?\s?\d[A-Z]{2}$/i,
CA: /^[A-Z]\d[A-Z]\s?\d[A-Z]\d$/i,
NL: /^\d{4}\s?[A-Z]{2}$/i,
DE: /^\d{5}$/
};
function isPostcodeValid(country, value) {
const v = value.trim();
const pattern = postcodePatterns[country];
if (!pattern) return true; // unknown country: do not block
return pattern.test(v);
}Before
- One 5-digit pattern for every visitor
- State required for all countries
- Error says only 'Invalid postcode'
- Visitors invent fake ZIP codes or leave
After
- Pattern chosen from the country field
- State required only where used
- Error shows the expected format
- Real addresses accepted and saved cleanly
How to confirm it's fixed
Repeat the manual test
Submit each sample address from the checklist and confirm none is rejected.
Check the result
Confirm the lead arrives in the inbox and CRM, or the test order appears (use test mode for payments), with the postcode saved correctly.
Test on mobile
Mobile keyboards and autofill can add spaces or different case. Try autofill with an international saved address.
Check that bad input is still caught
Enter clearly wrong values such as 'abc' for a US ZIP and confirm a useful error appears.
How to prevent it happening again
- Use a maintained address or postcode library rather than home-made regex
- Add new markets to your test address list before launching ads there
- Retest address forms after plugin, theme or checkout updates
- Review leads monthly for placeholder postcodes
- Keep front-end and backend rules in sync and document them
How FunnelGuard handles this
FunnelGuard does not check this yet. Country-specific postcode rejection is a possible future check, but today it is not part of the service.
What FunnelGuard does run is a robot visitor that completes your real lead forms and checkouts on a schedule from the EU or the US, checks each step, and confirms that test leads reach your inbox and CRM. If a broken address rule stops that journey with the details the robot uses, you would see the failed step. It will not test every country's address format, so keep a manual test list of addresses for your markets. A free plan covers 1 site and 2 journeys with daily checks, and a free read-only website audit is available.
Questions people ask
Why does my form say my UK postcode is invalid?
The form is probably using a US ZIP rule that expects five digits. UK postcodes contain letters and a space, such as SW1A 1AA, so they fail. Change the rule to depend on the selected country or remove the digit-only restriction.
How do I validate postcodes for multiple countries?
Add a country field first, then apply a pattern for the chosen country. Use a maintained address library where you can, and accept any non-empty value for countries you have not listed so you do not block real customers.
Should the postcode field be required for every country?
No. Some countries have no postcode in common use. Require it only for countries that use one, and make state or province optional unless the country needs it.
Why does checkout ask for a state when I live outside the US?
The form treats state as required for all countries. Make the field conditional on the country, or optional, so customers elsewhere are not forced to invent a value.
How can I test address validation for other countries?
Select each target country in the form and submit a real sample address, with and without spaces, and with the optional fields blank. Also test on mobile with autofill, and check the lead or test order arrives with the right data.
Can I fix postcode validation without a developer?
Often yes. Most form builders and plugins let you change the postcode field to plain text and make state optional. A custom regex or backend rule needs someone to edit the code.
Does FunnelGuard check postcode validation for other countries?
Not yet. It is a possible future check. FunnelGuard runs your real journeys on a schedule and would show a failed step if its test details are rejected, but it does not test each country's format, so test manually.
Related issues
- DLV-234Phone field rejects international formatsFix guide
- DLV-231Submission timestamp stored in UTC but shown as localFix guide
- DLV-232Date field format (DD/MM vs MM/DD) swapped in the CRMFix guide
- DLV-233Non-ASCII names garbled (mojibake) in notification or CRMFix guide
- DLV-237Translated site's form posts to the default-language listFix guide
- DLV-236Currency wrong in order emails for multi-currency storesFix guide