Checkpost

How to limit address field length at Shopify checkout for carrier labels

Short answer: Stop addresses that are too long for your carrier's label format (often 35 characters) before they cause failed shipments. In Checkpost, choose “Limit address line length” from Templates, adjust the values, test it, then save and enable the rule.

The problem

Many carrier label formats truncate address lines at 35 characters, and some 3PLs reject longer ones outright. Long lines lead to failed label creation or misdelivery.

How to set it up

  1. Install Checkpost from the Shopify App Store.
  2. Open Templates and choose Limit address line length.
  3. Set the maximum length your carrier supports.
  4. Use Try this rule to test a sample cart, then click Save rule.

The rule

Checkout is blocked when any of these conditions are true:

Shoppers see: “Address lines must be 35 characters or fewer. Please move extra details to the second line.” at the address line 1, once they reach checkout.

Rule definition (JSON)
{
  "name": "Address line max 35 chars",
  "match": "any",
  "conditions": [
    {
      "kind": "text",
      "field": "ship_address1",
      "op": "length_gt",
      "values": [
        "35"
      ]
    },
    {
      "kind": "text",
      "field": "ship_address2",
      "op": "length_gt",
      "values": [
        "35"
      ]
    },
    {
      "kind": "text",
      "field": "ship_company",
      "op": "length_gt",
      "values": [
        "35"
      ]
    }
  ],
  "message": "Address lines must be 35 characters or fewer. Please move extra details to the second line.",
  "target": "address1",
  "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

FAQ

Does it count spaces?

Yes, after trimming leading and trailing spaces.

Can I limit the name fields too?

Yes. Add conditions for first or last name with the same length operator.

Related rules

Add limit address line length to your store