Beyond PO Boxes: Advanced Uses for Text Match Shipping Rules in Shopify
Unlock Custom Logic Based on Customer Names, Addresses, SKUs, and More

Think Shopify text match rules are just for blocking PO Boxes? Think again! Learn advanced strategies using Better Shipping to trigger rates, surcharges, or restrictions based on customer names, address lines, cities, SKUs, and more.
Many Shopify merchants know they can use shipping rules to restrict deliveries to PO Boxes. But the underlying Text Match capability within Better Shipping is far more powerful and versatile than just that single use case. By matching patterns in customer information or even product details, you can unlock highly specific, custom shipping logic.
If you can identify a customer segment or a shipping scenario by a piece of text associated with the order, chances are you can build a rule around it. Let's explore some advanced strategies beyond the basics.
Reminder: How Text Match Rules Work
Within Better Shipping's rule engine (Step 3), you can create rules that trigger based on whether a specific text field equals, contains, starts with, ends with (or does not) a certain string or list of strings. Fields you can match against include:
- Customer First Name / Last Name
- Address Line 1 / Address Line 2
- City
- State/Province (2-letter code)
- Country Code (2-letter code)
- Product Title / Product SKU (matching against items in the cart)
You can match against a single value or a comma-separated list (acting as an OR condition). Matching is case-insensitive by default but can be made case-sensitive. (Note: While Shopify sends the zip/postal code, Better Shipping uses dedicated fields for zip code restrictions, not the text match rule).
Advanced Use Cases for Text Match Rules
1. VIP / Wholesale Customer Rates:
- Goal: Offer special flat rates or discounted shipping to known wholesale or VIP customers.
- Method: If these customers have specific identifiers you can capture in their name or address (e.g., always use "Wholesale Buyer" as First Name, have "Ltd" in their company name field if entered in an address line, or you maintain a list of VIP last names):
- Rule Trigger: 'Customer First Name' 'equals' 'Wholesale Buyer' OR 'Customer Last Name' 'equals' 'Smith,Jones,VIPCustomer' OR 'Address Line 1' 'contains' 'Ltd, Inc'. (Use fields creatively based on how you identify these customers).
- Alternative Method: Instruct your VIP/Wholesale customers to enter a specific keyword (e.g., "VIPSHIP", "WHSALE") in the Address Line 2 field during checkout.
- Rule Trigger: 'Address Line 2' 'equals' 'VIPSHIP' OR 'Address Line 2' 'equals' 'WHSALE'.
- Rule Effect: 'Replace total shipping price' with $15.00 (Your wholesale flat rate).
- Placement: Place this rule early in your queue to ensure it applies before standard rates.
2. Address Line Keyword Surcharges/Restrictions:
- Goal: Add a surcharge for deliveries to potentially complex locations (apartments, rural routes) or restrict certain methods.
- Method: Match common terms in address lines.
- Rule Trigger: 'Address Line 1' 'contains' 'Apt,Suite,Unit,Floor,#' OR 'Address Line 2' 'contains' 'Apt,Suite,Unit,Floor,#'.
- Rule Effect: 'Add/Subtract amount' = Add $3.00 (Apartment Delivery Surcharge).
- --- OR ---
- Rule Trigger: 'Address Line 1' 'contains' 'RR ,Rural Route,PO Box' (add PO Box here too for robustness).
- Rule Effect (within an Express Rate): 'Disable shipping rate' (Restrict Express to rural/PO Box).
3. SKU/Title Pattern Matching for Product Groups:
- Goal: Apply specific shipping rules to groups of products without relying solely on tags or types, perhaps based on a naming convention.
- Method: Match patterns within product SKUs or titles.
- Rule Trigger: 'Product SKU' 'starts with' 'SALE-'.
- Rule Effect: 'Replace total shipping price' with $5.00 (Special rate for sale items).
- --- OR ---
- Rule Trigger: 'Product Title' 'contains' '(Pre-Order)'.
- Rule Effect: 'Add/Subtract amount' = Add $2.00 (Pre-order handling) OR Change the Rate Name/Description to include estimated ship date.
- Note: You can choose whether the rule should match if at least one product matches, or if each product in the cart must match.
4. Highly Specific Geo-Targeting (Beyond Zones):
- Goal: Offer a unique promotion only to customers in a specific city or group of cities, potentially more granular than your main Shopify zones allow.
- Method: Match directly on City name (or State/Country codes).
- Rule Trigger: 'City' 'equals' 'Portland,Seattle,Vancouver'.
- Rule Effect: 'Add/Subtract amount' = Subtract $5.00 (PNW Discount).
- Note: Be mindful of spelling variations if matching city names. Using State or Country codes is generally more reliable.
5. Filtering Test Orders or Internal Staff:
- Goal: Prevent test orders or staff orders from skewing analytics or receiving standard rates.
- Method: Use a specific name pattern agreed upon for testing/staff.
- Rule Trigger: 'Customer Last Name' 'equals' 'TestOrder' OR 'Customer First Name' 'equals' 'StaffTest'.
- Rule Effect: 'Replace total shipping price' with $0.01 OR 'Disable shipping rate' (depending on your goal).
Combining Text Match with Other Rules
Remember, text match rules exist within the standard rule queue. They can be layered with price, weight, or product/tag-based rules for even more complex scenarios. For example, you could offer the VIP rate (matched by Last Name) only if their order total is also over $500.
Multi-Location Impact
Text match rules generally operate on the customer and address information provided in the shipping request, which is consistent regardless of product location. Therefore, these rules typically work reliably even in multi-location setups. They can be effectively combined with product-based rules that do benefit from the Unified Cart Calculation beta feature for holistic accuracy.
Unleash Creative Shipping Logic
Don't limit your thinking about shipping rules to just price and weight. Better Shipping's Text Match trigger opens up a world of possibilities for segmenting customers, handling address variations, and applying logic based on product identifiers.
Think about the unique characteristics of your customers, products, or fulfillment challenges. Is there a text pattern you can leverage?
Explore the creative potential of Text Match rules. Install Better Shipping and see how you can tailor your shipping logic with unparalleled precision.
