On this page
What this issue is
A postcode (called a ZIP code in the US) is the part of an address used to work out delivery and tax. This issue happens when a customer types a valid postcode and the checkout still says it is invalid, or silently shows no delivery options for it.
There are two common forms. In the first, a field error appears, such as "Please enter a valid postcode". In the second, there is no error at all, but the shipping step stays empty or says nothing is available.
Why it costs you leads or sales
The customer has already chosen products and started paying. A rejected address is a hard stop. Most people won't guess what is wrong. They leave, and you never see the lost order because nothing errors on your side.
It often hits only some customers: one region, one country, or postcodes with spaces or lowercase letters. That makes it easy to miss in your own testing.
- CartItems added
- Address formValid postcode rejected or no rates
- Shipping methodNever reached
- PaymentNever reached
- Order confirmedNo sale, no purchase tag
The customer enters a real postcode and the flow stops at the address step.
Example: illustrative numbers showing how a bad rule on one postcode format drags down completion for those customers only.
How to check if your site has it
Run a test order as a customer would, using real postcodes. Don't just test your own.
- Your own postcode, to confirm the baseline works
- A postcode typed with a space and without one (for example SW1A 1AA and SW1A1AA)
- The same postcode in lowercase
- A rural or newly issued postcode in each country you ship to
- A US ZIP+4 code such as 90210-1234 if you sell in the US
- A postcode in each shipping zone you have set up
- A postcode for a territory or island you list as shipped to
- Autofilled addresses from the browser, as well as typed ones
For each one, note whether you get a field error, an empty shipping step, or normal rates. Also open the browser console and network tab. A failed address or rates request there points to the cause.
| Symptom | Likely cause |
|---|---|
| Field error on valid postcode with a space | Format rule too strict (pattern or regex) |
| Field error for one country only | Wrong country format or validator set for that country |
| No error, but no shipping rates | Postcode not covered by a shipping zone or rate |
| Works typed, fails when autofilled | Extra spaces or different casing in the value |
| Newer postcodes fail | Outdated address database or validation app |
How to fix it
Reproduce it with the exact value
Copy the postcode and country the customer used. Enter it in a test checkout and note the exact message.
Find who is rejecting it
Check the network tab. If the rejection comes from your theme or custom script, fix the pattern. If it comes from an app or a rates service, fix it there.
Normalise the input
Trim spaces, ignore case and accept the code with or without the internal space before you validate it.
Cover the postcode in shipping zones
If there is no error but no rates, add the postcode's country or region to a shipping zone and give it a rate.
Retest every format
Repeat the checklist above and place one test order end to end.
Check shipping zones
Go to Settings > Shipping and delivery and open the profile. Confirm the customer's country or region is in a zone with a rate.
Review apps and scripts
Disable any address validation or postcode-restriction app and retest. Check theme code that limits postcodes, if you added any.
Check the country list
In Settings > Markets, make sure the country is enabled for selling and shipping.
Check WooCommerce zones
Go to WooCommerce > Settings > Shipping. If a zone uses postcode limits, check the ranges and wildcards (for example SW1*). Postcodes outside every zone get no rates.
Check the checkout plugin
If you use a checkout field editor or address validation plugin, switch it off briefly and retest.
Update WooCommerce
Newer versions fix postcode format handling for several countries. Update on a staging copy first.
Replace strict patterns
Make the pattern accept optional spaces and any case, and apply it only after choosing the country.
Validate on the server too
Make sure the server uses the same rules as the browser, so one doesn't reject what the other accepts.
Keep the rule simple
If a rule keeps rejecting real codes, show a warning rather than blocking the order.
function isValidUkPostcode(input) {
const value = input.trim().toUpperCase().replace(/\s+/g, '');
return /^[A-Z]{1,2}[0-9][A-Z0-9]?[0-9][A-Z]{2}$/.test(value);
}
console.log(isValidUkPostcode('sw1a 1aa')); // true
console.log(isValidUkPostcode('SW1A1AA')); // trueBroken
- Pattern rejects spaces or lowercase
- One rule applied to every country
- Postcode missing from every shipping zone
Fixed
- Input is cleaned before checking
- Rule chosen by country
- Every sold-to postcode matches a zone and rate
How to confirm it's fixed
Repeat every postcode from your test list in a fresh browser session. Each one should reach the shipping step and show at least one rate. Then complete a test order, using your store's test mode where you have it, and check that it appears in your orders.
How to prevent it happening again
- Test real postcodes from each market after any change to shipping zones, apps or the checkout theme
- Keep a short list of tricky postcodes (spaces, rural, new ranges) and reuse it
- Avoid hand-written postcode patterns where the platform's own validation is enough
- Update address validation apps and plugins on a schedule, on staging first
- Look at support emails for any mention of 'invalid postcode'
How FunnelGuard handles this
FunnelGuard detects this issue only partly. Its journey fills in the address step and then checks whether shipping is available: it flags it when no rates come back for a valid postcode. It does not read the field error message itself, so a visible 'invalid postcode' warning is not detected as such.
That means FunnelGuard covers the empty-shipping case for the postcode your journey uses. It does not cover every postcode, country or format a real customer might type. To cover the rest by hand, run the postcode checklist above after each change, and add a postcode from each shipping zone to your own test routine.
When a check fails, it is re-run from a second region before one alert goes out, with a screenshot and a likely cause. You can try it with the Free plan (1 site, 2 journeys, daily checks, no card), or use the free read-only website audit.
Questions people ask
Why does my checkout say my postcode is invalid when it's correct?
The most common causes are a format rule that rejects spaces or lowercase letters, a rule meant for another country, or an outdated address validator that doesn't know newer postcodes. Try the code with and without the space, then check which app or script produces the error.
Why do I get no shipping rates for a valid postcode?
The postcode probably isn't covered by any shipping zone or rate. Check that its country or region is in a zone, and that any postcode ranges or wildcards on that zone include it.
How do I fix an invalid postcode error in WooCommerce?
Go to WooCommerce > Settings > Shipping and check the zone's postcode limits. Then disable any checkout field or address validation plugin, retest, and update WooCommerce on a staging copy.
How do I fix an invalid postal code error on Shopify?
Check Settings > Shipping and delivery for a zone and rate covering the country, and confirm the country is enabled in Settings > Markets. If the error persists, disable address validation apps and retest.
Should I validate postcodes with a regex?
Only loosely. Trim spaces, ignore case and pick the pattern by country. Strict patterns reject real codes, so a warning is often safer than blocking the order.
Can FunnelGuard detect a rejected postcode?
Partly. It fills in the address step and flags when no shipping rates are available for a valid postcode. It does not read field error messages and only tests the postcodes in your journey.
Why does the postcode work when typed but fail when autofilled?
Autofill can add extra spaces, different casing or a ZIP+4 suffix. Normalise the value before validating, and test autofilled addresses as well as typed ones.
Related issues
- CNV-175No shipping options for a valid addressFix guide
- CNV-181Address autocomplete (Google Places) brokenFix guide
- CNV-177Shipping to advertised countries blockedFix guide
- CNV-184Shipping rates API timeout blocks checkoutFix guide
- CNV-176Shipping cost wrong or zeroFix guide
- CNV-178Tax not calculated or doubledFix guide