How to block specific ZIP or postal codes at Shopify checkout
Short answer: Block checkout for postal codes you can't deliver to, using exact codes or prefixes (for example remote islands or rural areas). In Checkpost, choose “Block specific ZIP / postal codes” from Templates, adjust the values, test it, then save and enable the rule.
The problem
Remote islands, rural routes and specific postal areas often carry surcharges or aren't served by your carrier. Without a block you either eat the surcharge or cancel the order after payment.
How to set it up
- Install Checkpost from the Shopify App Store.
- Open Templates and choose Block specific ZIP / postal codes.
- List full postal codes, or switch the operator to "starts with" to block whole areas by prefix.
- Use Try this rule to test a sample cart, then click Save rule.
The rule
Checkout is blocked when all of these conditions is true:
- ZIP / postal code starts with any of HS, ZE, KW15, KW17
Shoppers see: “We can't deliver to this postal code yet.” at the zip / postal code field, once they reach checkout.
Rule definition (JSON)
{
"name": "Undeliverable postal codes",
"match": "all",
"conditions": [
{
"kind": "text",
"field": "ship_zip",
"op": "starts_with_any",
"values": [
"HS",
"ZE",
"KW15",
"KW17"
]
}
],
"message": "We can't deliver to this postal code yet.",
"target": "zip",
"runOn": "checkout"
}Where this rule works
These are cart and checkout validations, including supported accelerated checkouts. They are current-cart policies; they do not track previous purchases of a SKU. Shopify excludes POS, recurring subscription orders and native pre-order/Try Before You Buy flows from this API. See Shopify's validation compatibility.
Tips
- Use "starts with" to block whole areas by prefix, e.g. Scottish islands (HS, ZE, KW15-17) or Alaska ZIPs starting 995-999.
- Spaces are ignored, so "HS1 2AA" and "HS12AA" are treated the same.
- Add a country condition if a prefix could match postal codes in more than one country.
FAQ
Can I upload a long list of postal codes?
Yes. Paste codes separated by commas or new lines. For very long lists, prefixes are faster to maintain than individual codes.
Can I charge more instead of blocking?
Checkpost blocks or allows checkout. For surcharges, use Shopify shipping rate conditions or a delivery customization app alongside it.
Related rules
Block PO Box addresses
Stop checkout when the shipping address contains a PO Box, so carriers that cannot deliver to PO Boxes never receive the order.
Block shipping to specific countries
Prevent orders from being placed with a shipping address in countries you cannot or do not want to serve.
Only allow listed postal codes (local delivery)
Allow checkout only when the shipping postal code is inside your delivery area — ideal for local bakeries, florists and grocery delivery.
Restrict products in certain states
Block checkout when a restricted product (for example knives, vapes, supplements or CBD) is shipped to a state or province where it can't be sold.