Setting up an address blocker in Checkout Blocks

The Address blocker app block can block checkout when an address or specific components of an address aren't allowed according to the rules that you define. You can set up an address blocker to apply to all markets or to 1 specific market.

Supported address rules

The following rule types are supported for blocking checkout:

  • ASCII characters: You can block addresses that contain emojis or special characters. Many shipping providers don't support these characters.
  • Blocked address type: You can block PO boxes, USPS Gopost, diplomatic and military addresses, and parcel lockers.
  • Character maximum and Character minimum: You can require a maximum or minimum character limit on any shipping address field.
  • Custom allow rule and Custom block rule: Apply custom regex (regular expressions) on any shipping address field.
  • Required fields: You can require specific fields, such as a phone number.
  • Zipcodes: You can block specific ZIP codes and ZIP code ranges.

Using regex in custom address rules

If you need to block specific address formats, then use the Custom allow rule or Custom block rule, which accepts any valid regular expression (regex). A regex is a string of characters that specifies a match pattern in text.

Here are some regex examples:

  • Match strings containing Japanese characters: /[一-龠]+|[ぁ-ゔ]+|[ァ-ヴー]+|[々〆〤ヶ]+/u
  • Match strings containing the word "avenue": (\W|^)avenue(\W|$)

When you add a regex string to your custom rule, Checkout Blocks displays either Valid or Invalid to indicate the status of your regex string. Click Test rule and type in a Sample input to test your regex string and confirm whether your regex string operates as expected. Click Reset to type in another sample.

Create an address blocker

You can create and configure an address blocker in the Checkout Blocks app.

You can create an address blocker for all markets, or for a single market. It isn't possible to create different address blocking rule groups for different markets at the same time.

Steps:

  1. From your Shopify admin, go to Sales channels > Checkout Blocks.
  2. Click Blocks, and then click Create block.
  3. Click Address blocker.
  4. In the Blocking rules section, configure your address blocking rule groups:
    1. Click ⊕ Create rule group.
    2. Optional: From the All markets drop-down menu, select the market that you want to apply the rule group to.
    3. Click ⊕ Add new rule, and then select the rule type that you want to apply.
    4. Configure the rule settings.
    5. Optional: If you want to customize the error message that displays when an address is blocked by a particular rule, then click Customize and type in your preferred message.
    6. Optional: Add more rules and configure them as required.
  5. Optional: In the Address autofill section, activate the Prepend country dial code to phone field setting. This is recommended when the phone field is required.
  6. Click Save.

After an address blocker is created, it must be added to the checkout.

Add an address blocker block to checkout

After you create an address blocker, you must add it to the checkout for it to start blocking checkout. You only need to add the address blocker to the checkout only one time.

Steps:

  1. From your Shopify admin, go to Settings > Checkout.

  2. In the Configurations section, click Customize on the configuration that you want to add the address blocker to.

  3. In the checkout and accounts editor, add the address blocker to the checkout:

    1. Click the Apps tab in the sidebar.
    2. Click the Address blocker Checkout Blocks option, and then click > Checkout.
    3. Confirm that the Allow app to block checkout setting is active.
  4. Click Save.

Can’t find the answers you’re looking for? We’re here to help.