Shopify how-to
How to restrict shipping by ZIP code on Shopify
Some restrictions don’t follow state lines. A delivery radius for a perishable product, a service area you can actually reach, a limit your own review draws around part of a state — each one is a list of ZIP codes. Here is how to turn that list into a checkout rule, from a single ZIP code to thousands of them.
What Shopify can do on its own
Shopify’s shipping zones are groups of countries or regions, so a zone can’t single out a ZIP code, and each product sits in one shipping profile. Local delivery can be limited to a list of postal codes, but only for local delivery.
To stop particular products from checking out to particular ZIP codes, the check has to happen in checkout itself. That is what a checkout validation app does: ShipEmbargo reads the buyer’s shipping address and stops the order with a message you wrote.
Three ways to write a ZIP code
- One ZIP code:
US:90210. - A prefix, for every ZIP code that starts the same way:
US:902*covers 90200 to 90299. - A range, both ends included:
US:90001-90100.
Every entry names its country, so a US ZIP code can never match an address abroad. Postal codes elsewhere work the same way — GB:SW1A1AA, or GB:SW1* for an area — but only US ZIP codes take ranges. A buyer who types a ZIP+4 is matched on its first five digits, so there’s no need to list those.
Import the list you already have
Most ZIP lists live in a spreadsheet. In the rule editor, Import a list takes a column you paste, or a CSV or text file, and adds it to the rule; save a spreadsheet file as CSV first. Plain values are read as US ZIP codes — ranges like 90001-91316 and prefixes like 902* included — and leading zeros the spreadsheet dropped are put back (2134 becomes 02134) and counted, so you can see it happened. A header row and repeats are skipped, and it reports what it couldn’t read, with the line numbers of the first ten. The file is read in your browser and never uploaded, and nothing reaches checkout until you review the list and save the rule.
Block a list, or allow only a list
A rule points one of two ways. A block rule stops orders to the ZIP codes you list; an allow-only rule stops orders to everywhere else, which is the natural shape for a delivery radius. A rule’s states, countries and ZIP codes add together, so a ZIP code can’t carve an exception out of a state the same rule names.
How long a list can be
What decides whether a list fits is how its ZIP codes are grouped, more than how many there are. A store’s rules share room for up to 814 runs — ZIP codes in unbroken order that the same rules list — and fewer once more than five active rules list US ZIP codes. A range of a thousand consecutive ZIP codes is one run; a thousand ZIP codes with gaps between them are a thousand runs.
Each rule can list up to 10,000 US entries, and the editor shows how many ZIP codes and runs your list covers before you save. If the rules don’t fit, publishing says so, and the rule stays saved while you tighten the list. The FAQ has the details.
Where ZIP codes and other boundaries part ways
ZIP codes are sets of mail delivery routes, not areas drawn along city or county lines. When a restriction on your list is drawn around a city or a county, build the ZIP list from an authoritative source, and decide deliberately what to do with ZIP codes that sit only partly inside it.
Common questions
Can Shopify restrict shipping by ZIP code without an app?
Not for particular products. Shipping zones are groups of countries or regions, and local delivery's postal-code list only governs local delivery, so stopping specific products from checking out to specific ZIP codes generally takes a checkout validation app.
Does a ZIP code rule catch ZIP+4 addresses?
Yes. A buyer's ZIP+4 is matched on its first five digits, so listing 90210 covers 90210-1234.
Can I restrict shipping by postal code outside the US?
Yes. Write the code with its country, like GB:SW1A1AA, or use a prefix like GB:SW1* for an area. Ranges work for US ZIP codes only.
This guide is general information for merchants, not legal advice. Regulations change — verify current law for your products and destinations.