PO box and address blocking after Shopify Scripts
I'm Tyler, and I make LeDuc Address Rules. A common Shopify Script hid every shipping rate when the address looked like a PO box, so the shopper couldn't finish checkout. That script stopped running on June 30, 2026. The Functions way is a checkout validation that shows a clear message at the address field.
What the Script approach looked like
Shipping scripts could read the shipping address and hide shipping rates. To block PO boxes, a script matched text such as "PO Box" in the address and hid every rate. The shopper then saw that no shipping was available, with no reason given, and often left.
The Functions way
There are two Function APIs you can use:
- Delivery Customization can hide or rename shipping rates. It is the direct port of the old shipping script, with the same unclear result for the shopper.
- Cart and Checkout Validation can return an error tied to a field, such as the Address field. Checkout shows your message next to that field and won't place the order until the address is fixed. This is the better fit for blocking addresses.
Shopify's own Checkout Blocks app had an address blocker, but Shopify deprecated it and set it to sunset on August 31, 2026.
With LeDuc Address Rules
- Install the app and open it. PO boxes are blocked from the first visit.
- Turn on the other rules you need and edit the messages shoppers see.
- Type an address under Test an address to see what checkout would say.
- Try a blocked address in your checkout, such as
PO Box 123. The message shows at the Address field.
What it can block
- PO boxes: PO Box, P.O. Box, Post Office Box, POB, PO Drawer, Locked Bag, and Box 123 at the start of a line, plus Postfach, Boîte Postale, Apartado, Casilla and Caixa Postal. Streets like "Box Canyon Road" and "Boxwood Lane" pass.
- APO, FPO and DPO military addresses.
- Package forwarders that name well-known services, plus warehouse addresses you add.
- Countries, states and provinces, and ZIP or postal codes, including prefixes and ranges, to block or to allow only.
- Your own words, and rules that apply only when the cart has a tagged product, for example hazmat.
Blocking PO boxes is on the free plan; the other rules are on the paid plan. Local pickup is never blocked. Addresses are checked inside Shopify and are never sent to or kept on my server. More detail: LeDuc Address Rules.
Status, November 2026: my Shopify apps are in Shopify App Store review and not installable yet. Each app's page will link to its App Store listing once it is approved.
Back to all Shopify Scripts replacements. Questions? Email me at tyler@leducsystems.com.
FAQ
Use a cart and checkout validation function. It shows a message at the Address field and checkout won't place the order until the address is fixed. LeDuc Address Rules does this, with PO boxes blocked on its free plan.
Yes, with a Delivery Customization function. It works like the old shipping script, but the shopper only sees that no shipping is available, with no reason.
No. LeDuc Address Rules never blocks local pickup or pickup points, because nothing ships to the shopper's address.
No. Stores on any plan can use public App Store apps that contain functions. Only custom apps with functions need Plus.
Sources: Shopify developer changelog, Shopify Scripts will be deprecated on June 30, 2026; Shopify Help Center, Transitioning from Shopify Scripts to Shopify Functions; Shopify developer docs, Function APIs. Read on 2026-11-07.