← All notes

HBN Notes / Shopify guide

How to block ZIP codes and postal codes on Shopify

Choose between shipping zones and checkout validation, build a precise ZIP or postal-code rule, and test boundaries without rejecting supported addresses.

A carrier excludes a handful of remote areas. One supplier cannot serve a particular region. Or local delivery stops at a clear postal boundary. In each case, the useful rule is narrower than “we do not ship there.”

ZIP and postal codes can express that boundary, but only if the list comes from a real fulfillment decision. They are not a substitute for checking whether the address exists, and they do not calculate distance or live carrier coverage.

First decide whether you need a rate boundary or an order block

Use Shopify's shipping and delivery settings when the problem is simply which rates or local-delivery options should be available in an area. A checkout validation rule is different: it stops the order and asks the shopper to change the address or cart.

Shopify's current address format validation supports blocking specified ZIP or postal codes, including wildcard patterns. A dedicated validation app can be useful when the restriction needs a product scope, several independently ordered policies, country-aware ranges, exceptions, or its own testing workflow. Choose the smallest mechanism that describes the operating constraint.

Do not use a checkout block to repair a missing rate. If the destination should be serviceable, fix the delivery profile, zone, or carrier setup instead of teaching customers that a valid area is forbidden.

Turn the service boundary into the least surprising match

An exact list works for a small number of known codes. A prefix is easier to maintain when every code beginning with the same characters shares the same outcome. A numeric range is appropriate only when both endpoints and every value between them belong to the same service area. These forms are not interchangeable.

Keep country context with the rule. “2000” can describe different places in different postal systems, and letter-and-number postcodes should not be forced into a numeric range. Preserve leading zeros, spaces, and significant letters when the tool expects them. For an allowlist, remember that omission becomes a block: a newly supported code will remain unavailable until someone adds it.

Product scope needs the same discipline. If only refrigerated items or one supplier's products have the limitation, a store-wide postal rule is broader than the fulfillment problem. Define the product group first, then test it using the product-specific restriction matrix.

Test the seams, not just one obvious blocked code

For a hypothetical inclusive range from 10001 through 10005, a useful test set is 10000, 10001, 10003, 10005, and 10006. That proves both boundaries, an interior value, and the nearest allowed values. For a prefix, try a code that shares only the first few characters and another with different spacing or case where the postal system allows it.

  • Test one blocked code and one accepted code in the same country.
  • Try a code that looks similar in a different country.
  • Check the exact endpoints of every range.
  • Test a matching and non-matching product, then put both in one cart.
  • Correct the address and retry the final order action with test payment.

A simulator can make isolated rule checks faster, but it cannot prove every mixed cart, split delivery, saved address, or accelerated checkout path. Keep at least one complete test checkout in the launch checklist.

Write a message that distinguishes policy from address accuracy

“Invalid ZIP code” is misleading when the code is real but outside your service area. Use the reason the shopper can act on: “This item is not available for delivery to this postal area. Use another delivery address or remove the item.” If removing the item would not solve the problem, do not offer it as an option.

Keep the source list, owner, and review date beside the rule. Carrier coverage, supplier boundaries, and local-delivery areas change. A technically correct postal match can still become an outdated business decision.