Block checkout with a custom error message
In short
Make a rule with the conditions that should stop the order, then add a Show Error Message action with your text. The Rules Executor must be in checkout and allowed to block checkout progress.
✓ Applies to
- Deluxe plan only (checkout rules aren't included in Advanced)
- Shopify Plus checkout, with the Rules Executor block added
- Any condition in the rule builder, such as cart total, products, shipping country or address fields
✕ Doesn't apply to
- Warnings that let the buyer continue. This action always blocks
- The thank-you and order status pages
Before you start
- Add the Rules Executor and allow it to block checkout progress. How.
Steps
Start a new rule
Open Rules → New checkout rule. Type a Title (up to 30 characters). Buyers never see it.
Add the conditions
Click Add condition and set when to block. With more than one, pick All (every one must match) or Any (one is enough) in Condition Match Type.
Write the message
Click Add Action → Show Error Message. Pick a Position and write the Message. Tell the buyer what to change.
Turn it on
Set Status to Active and click Save.
A rule with no conditions blocks every checkout. Add a condition before you set it to Active.
Example: block PO boxes
Condition Shipping Address 1, operator Match regex ( Regular Expression), value [Pp]\.?\s*[Oo]\.?\s*[Bb][Oo][Xx]. Position Shipping Address 1. This catches PO Box, P.O. Box and po box. (Contains is case-sensitive, so it would miss some.)
Check it works
- Use a cart and address that match. Try to continue. The message shows and you’re stuck.
- Change the address so it doesn’t match. You can continue.
Good to know
- The buyer gets past it by changing their checkout so the rule no longer matches.
- The message is plain text: no links, no formatting, one text for all languages.
- On three-page checkout, it only blocks on the page where the Rules Executor sits.
Not working?
- Buyers still continue: the Rules Executor isn’t allowed to block, or isn’t on that page. Fix.
- Message never shows: check Active and All vs Any. Full checklist.
- Not showing next to Email or Phone: use Top of the checkout. It still blocks.
Frequently asked
Can I show the error next to a specific field? +
Yes. Position offers Top of the checkout, Shipping Address 1, Shipping Address 2, First Name, Last Name, Email and Phone.
How does the buyer get past the error? +
By changing their checkout so the rule's conditions no longer match, for example entering a different address or removing a product. The rule re-checks every time the checkout changes.
Can I block checkout only for some countries? +
Yes. Add a Shipping Country condition set to Is, list the country codes, and add the Show Error Message action.
Can the message be translated? +
No. The Message field holds one text, and buyers see it exactly as written in every language.