Eren Labs JOURNAL TR
WooCommerce Errors

“… is not a valid postcode / ZIP” in WooCommerce: how postcodes are checked, country by country

WooCommerce checks the postcode against the format of the selected country, so a correct postcode fails if the country is wrong. Here is what the check accepts, which countries have a format rule, and what to tell the customer.

In this article13 sections

This notice means the postcode doesn’t match the format WooCommerce expects for the country selected in the same address. The check knows nothing about which postcodes actually exist. It only compares the shape, such as five digits for the United States or 1234 AB for the Netherlands.

Because the format depends on the country field, a perfectly correct postcode fails when the country is wrong. That is the first thing to check.

The exact message#

Billing ZIP Code is not a valid postcode / ZIP.

The same failure can also read:

  • Billing Postcode / ZIP is not a valid postcode / ZIP.
  • Shipping Postcode is not a valid postcode / ZIP.
  • Billing Eircode is not valid. You can look up the correct Eircode here.
  • Please enter a valid postcode / ZIP.
  • Please enter a valid postcode
  • The provided postcode / ZIP is not valid

Who sees it: Shoppers, after pressing Place order on the classic checkout. The field name in front comes from the country’s label (ZIP Code for the United States, Postcode for the United Kingdom, Postal code for Canada) with Billing or Shipping in front. Irish addresses get the Eircode wording. The cart page’s shipping calculator says “Please enter a valid postcode / ZIP.” The checkout block shows “Please enter a valid postcode” under the field.

What WooCommerce checks#

For each postcode field on the checkout, WooCommerce:

  1. Tidies it: uppercase, spaces and hyphens removed, then put back where that country normally has them. sw1a1aa becomes SW1A 1AA for the United Kingdom.
  2. Rejects it if it contains anything other than letters, digits, spaces and hyphens. This applies to every country.
  3. Compares it with the format rule for the selected country. WooCommerce 11.2.1 has rules for 33 countries, including the United States, Canada, the United Kingdom, Ireland, most of the EU, Brazil, India and Japan. Countries without a rule accept any postcode that passed step 2.
  4. Lets plugins overrule the country rule through woocommerce_validate_postcode. A postcode refused for its characters never reaches the filter.

An empty postcode is never checked here. If the field is required, the customer gets the required-field message instead.

Causes and how to fix each one#

1. The wrong country is selected#

The checkout often starts with a country already chosen: your shop’s country, a geolocated guess, or the country saved on the customer’s account. A customer who types their postcode without noticing the country gets their own, correct postcode rejected against another country’s format.

Check: Look at the Country / Region field in the same address section, billing or shipping, as the field named in the message.

Fix: The customer selects the right country. If wrong guesses are frequent, review Default customer location under WooCommerce > Settings > General.

2. The postcode is in the wrong format for the country#

Formats are strict. A US ZIP code needs five digits, optionally followed by a hyphen and four more. A Canadian postal code is letter-digit-letter digit-letter-digit. Portugal needs 1234-567, Poland 12-345, Germany five digits. Missing digits, an old format, or extra characters at the end fail. Spaces and hyphens are forgiven, because WooCommerce re-inserts them itself.

Check: Compare the postcode with the country’s usual format, digit by digit.

Fix: The customer corrects the postcode.

3. The postcode contains other characters#

Dots, commas, slashes, the # sign and letters with accents are rejected for every country, including countries without a format rule. Copying an address from an email or a spreadsheet can bring invisible or stray characters along.

Check: Ask the customer to retype the postcode by hand rather than pasting it.

Fix: Remove the extra characters.

4. It is the shipping address that fails#

When Ship to a different address is ticked, the shipping postcode is checked against the shipping country, separately from billing. The message then starts with Shipping. Customers often fix the billing fields and miss that the second address has its own country.

Check: Read whether the message says Billing or Shipping.

Fix: Correct the country or postcode in that section.

5. A plugin has its own postcode rules#

Delivery-area, local delivery and address-validation plugins can reject postcodes through the woocommerce_validate_postcode filter, for example to accept only postcodes you deliver to. The message stays the same, so it looks like a format problem even when the postcode is well formed.

Check: Test the same address with other plugins turned off, using the Health Check & Troubleshooting plugin.

Fix: Change that plugin’s list of allowed postcodes, or contact its developer.

Quick reference#

CauseHow to checkFix
The wrong country is selectedLook at the Country / Region field in the same address section, billing or shipping, as the field named in the message.The customer selects the right country. If wrong guesses are frequent, review Default customer location under WooCommerce > Settings > General.
The postcode is in the wrong format for the countryCompare the postcode with the country's usual format, digit by digit.The customer corrects the postcode.
The postcode contains other charactersAsk the customer to retype the postcode by hand rather than pasting it.Remove the extra characters.
It is the shipping address that failsRead whether the message says Billing or Shipping.Correct the country or postcode in that section.
A plugin has its own postcode rulesTest the same address with other plugins turned off, using the Health Check & Troubleshooting plugin.Change that plugin's list of allowed postcodes, or contact its developer.

Reproduced on a test store#

We set up each case below on a clean WooCommerce 11.2.1 store on 6 November 2026 and recorded exactly what it showed.

What we didWhat WooCommerce showed
Classic checkout, logged out, a product priced 10. Billing country United States (US), ZIP Code 1234. Place the order.Billing ZIP Code is not a valid postcode / ZIP.
Billing country United States (US), ZIP Code SW1A 1AA (a UK postcode). Place the order.Billing ZIP Code is not a valid postcode / ZIP.
Billing country France, Postcode 75.001. Place the order.Billing Postcode / ZIP is not a valid postcode / ZIP.
Billing country Australia, Postcode ABC12. Place the order.Accepted (no format rule for Australia, only letters, digits, spaces and hyphens are required).
Classic cart page, shipping calculator: country Germany, postcode 1234. Press Update.Please enter a valid postcode / ZIP.
Billing country Ireland, Eircode 12345. Place the order.Billing Eircode is not valid. You can look up the correct Eircode here.

For developers#

To test a postcode the way the checkout does, run this in wp shell:

$pc = wc_format_postcode( '1234', 'US' );
var_dump( $pc, WC_Validation::is_postcode( $pc, 'US' ) );

Your own rule goes in woocommerce_validate_postcode, which receives the result, the postcode and the country. The wording can be changed with woocommerce_checkout_postcode_validation_notice, which also receives the country and the postcode.

Where this lives in WooCommerce 11.2.1:

  • includes/class-wc-checkout.php, WC_Checkout::validate_posted_data: Formats each postcode field for its country, then adds the message when WC_Validation::is_postcode() fails; filter woocommerce_checkout_postcode_validation_notice.
  • includes/class-wc-validation.php, WC_Validation::is_postcode: Rejects anything other than letters, digits, spaces and hyphens, then applies the country’s rule; filter woocommerce_validate_postcode.
  • src/Internal/Utilities/PostcodeValidation.php, PostcodeValidation::validate: Country patterns from i18n/postcode-validation-rules.json (33 countries in 11.2.1); countries without a rule pass.
  • includes/wc-formatting-functions.php, wc_format_postcode: Uppercases, removes spaces and hyphens, then re-inserts them in the country’s usual place before the check.
  • includes/shortcodes/class-wc-shortcode-cart.php, WC_Shortcode_Cart::calculate_shipping: The cart shipping calculator’s version of the check.
  • src/StoreApi/Schemas/V1/AbstractAddressSchema.php, AbstractAddressSchema::validate_callback: The Store API’s server-side check for the block cart and checkout.

Back to the WooCommerce error reference.

Frequently asked questions#


Does WooCommerce check that the postcode really exists?

No. It only checks the format for the selected country. A well-formed postcode that doesn’t exist passes.


Why is a correct UK postcode rejected?

Usually because the country field is set to another country, such as the United States. The postcode is checked against the selected country’s format.


Do I need to type the space or hyphen?

No. WooCommerce removes spaces and hyphens and puts them back in the right place before checking.


Which countries have a postcode format rule?

In WooCommerce 11.2.1, 33 countries, including the US, Canada, the UK, Ireland, Germany, France, the Netherlands, Brazil, India and Japan. Others only reject characters other than letters, digits, spaces and hyphens.


Can I turn the postcode check off?

A developer can return true from the woocommerce_validate_postcode filter to skip the country’s format rule. The filter can’t override the character check, so a postcode with dots, slashes or accented letters is still refused. Shipping rates and taxes that depend on postcodes will then be only as good as what customers type.


More in WooCommerce Errors

Keep exploring

All articles