Hide shipping methods for PO box addresses
Use ShipWith to manage Shopify PO box shipping by hiding delivery options when a delivery group's destination is an actual post-office box. The Address input rule's PO Box condition checks destination address lines 1 and 2. It does not classify private mailboxes or APO/FPO/DPO military addresses as PO boxes.
PO box detection is based on the address text provided to Shopify. It can recognize common forms such as PO Box 42, P.O. Box 42, and Post Office Box 42, but it cannot guarantee that every unusual spelling or inaccurate customer entry will be identified.
Create the rule
- Create a shipping rule.
- Enter a descriptive Rule name, such as
Hide Express for PO boxes. - Select Address input for Function input. The input cannot be changed after the rule is created. Address input provides the detailed destination address fields and PO box condition needed by this rule. Read Choose the right Function input type for your rule before making this locked choice.
- Under When the rule runs, select When set conditions are met.
- In Conditions, select PO Box, then select is. This is a boolean condition, so there is no value to enter. It matches when ShipWith finds a supported PO box form in destination address line 1 or line 2.
- Under Actions, choose one of these hide actions:
- Select Hide specific delivery method(s) to hide selected options. In Delivery method titles, enter each title or handle fragment and press Enter. For example, enter
expressto target an option whose title or handle contains that text. - Select Hide all delivery methods only if checkout should have no delivery option for a matching destination.
- Select Hide specific delivery method(s) to hide selected options. In Delivery method titles, enter each title or handle fragment and press Enter. For example, enter
- Set Status to Live.
- Select Save.
- Under Shopify sync, wait for Status to become Synced before testing. If the status is Failed or Not synced, select Retry sync and wait for Synced.
ShipWith can hide only options that Shopify supplies for the delivery group. When using Hide specific delivery method(s), matching ignores capitalization and can match any part of an option's title or handle. Check the targets carefully and leave at least one usable option unless hiding every option is intentional.
Test matching PO box addresses
After the rule is Live, saved, and Synced, test more than one supported format:
- Enter
P.O. Box 42in address line 1 and leave address line 2 blank. Confirm that the targeted delivery options are hidden. - Enter a street address such as
125 Main Streetin address line 1 andPost Office Box 77in address line 2. Confirm that the targeted options are hidden again.
These tests confirm that the condition checks both destination address lines. They do not prove that every possible PO box spelling will match.
Test addresses that should not match
Repeat checkout with realistic nonmatching addresses and confirm that the targeted options remain available when no other rule hides them:
- Use a normal street address, such as
125 Main StreetwithApartment 4Bon address line 2. - Use a private mailbox entry, such as
125 Main StreetwithPMB 42on address line 2. - Use an APO/FPO/DPO military address, such as
Unit 2050 Box 4190withAPO AE 09012.
Private mailboxes and APO/FPO/DPO military addresses are outside the PO box condition definition. If you need different behavior for them, do not rely on this condition to identify them.
Check every delivery group
Shopify can split one cart into multiple delivery groups. ShipWith evaluates the destination address and available delivery options separately for each group. A PO box match hides the configured targets only in the matching group; it does not apply one group's result to every other group.
Test a split checkout when your fulfillment setup can produce one. Check the options in every delivery group, including groups whose destinations do not match and groups where Shopify did not supply the targeted option.
