Block or redirect by user agent
Overview
Keep a copying bot or an outdated browser out of your store, or send visitors on one type of device to another page. With every visit, a visitor's browser (or a bot) shares a short piece of information called the user agent. It names the browser, device, operating system or bot (for example GPTBot). A Block user agent or Redirect user agent rule looks at that information. You create these rules in Block & Re-director > Blacklist, and Blockify can write a text pattern for you with Generate with AI.
What you'll learn
- How to block or redirect by browser or device?
- Let AI write the pattern for you
- How it works?
- Who can use this feature?
How to block or redirect by browser or device?
Step 1: Go to Block & Re-director > Blacklist. Click Block then Block user agent, or Redirect then Redirect user agent.

Step 2: Set Status to Enable so the rule works as soon as you save it, or Disable to save it for later.

Step 3: Redirect rules only: fill in Redirect to (an External URL or a Shopify Market) and Displayed name (optional). See Use a Shopify Market as your redirect destination.
Step 4: Under Country, pick the countries the rule applies to, then choose a Type and fill in its fields (below).
Step 5: Add a private note if you want, then click Save. The rule appears in the Blacklist tab.
Type: Browser
Pick entries in Select browsers, and narrow the match with Select device (option) and Select OS (option) if needed.

Type: Substring
Enter a word or part of the text in Substring, for example AhrefsBot. A visitor matches when their browser information contains that text anywhere.

Type: Regex
Regex lets you catch many bots or browsers in one line with a text pattern. Enter the pattern in Regex pattern, for example (?i)(gptbot|claudebot|bytespider), or click Generate with AI next to the field and describe the visitors in plain words (see Let AI write the pattern for you).

(?i) at the beginning of your pattern to ignore the difference. Patterns are limited to 255 characters.Let AI write the pattern for you
Describe the traffic in your own words and Blockify writes, explains and lets you test the pattern. It works the same way in Block, Redirect and Whitelist rules.
Steps
Step 1: Start a user agent rule (Block, Redirect or Whitelist) and set Type to Regex.
Step 2: Click the Generate with AI icon on the right of the Regex pattern field.

Step 3: Describe the bots, browsers or visitors to match and click Generate. Be specific: "block AI crawlers such as GPTBot and ClaudeBot" works better than "block bad bots". English and Vietnamese are supported.
Step 4: Review the Generated rule, its What this rule does explanation and the Sample user agents badged Matched / Not matched.

Step 5: Paste a real visitor's browser information (you find it in the visitor log) into Test your rule to see whether that visitor would be caught. Not right? Click Regenerate.
Step 6: Click Use this rule. The pattern is filled into Regex pattern; you can still edit it by hand. Finish the rule and click Save.

Limits and warnings
- 10 generations per store per day; Regenerate counts as one, attempts that fail (for example when the AI takes too long) do not. At the limit, wait for it to reset or type the pattern by hand.
- Descriptions: 500 characters at most; each attempt takes up to 10 seconds. If no safe pattern can be produced, Blockify shows an error and keeps what you entered.
- Broad-pattern warning: if the pattern also matches ordinary browsers (for example from "block visitors on mobile"), a yellow warning appears and the browser rows under Sample user agents show as matched. If it matches every common browser you must tick I understand this rule would apply to every visitor first. Blockify does not stop you saving such a rule, so make sure that is what you want.
- Generated patterns follow the normal rules: capital and small letters count as different unless the pattern starts with
(?i), 255 characters at most.
How it works?
Type | Matches when | Example | |
|---|---|---|---|
Browser | The visitor's browser, device and OS match your selection | Internet Explorer on Windows | |
Substring | The visitor's browser information contains the text you entered |
| |
Regex | The visitor's browser information fits your pattern | `(?i)(scrapy | curl)` |
- A match from the selected countries is blocked (the visitor sees your blocking page) or redirected to the destination you set.
- Whitelist rules are checked before block rules, and good bots such as Googlebot are always let in first.
- Broad-pattern warning: if a pattern also matches ordinary browsers (Chrome, Safari…), Blockify warns that it would block real customers too (details under Limits and warnings).
- Unsafe-pattern warning: patterns such as
(a+)+or(a|a)+can take very long for Blockify to check and slow down your store. Blockify asks you to simplify them. - To count how many visitors a rule stopped, filter the visitor log by Block reason and a date range.
Who can use this feature?
User agent rules are available on the Premium plan and above. Generate with AI is available wherever you can create a user agent rule with Type = Regex (Block, Redirect and Whitelist) and follows the same tier.
FAQs
- Where do I find a visitor's browser information (user agent)?
Open the visitor log in Analytics and click the visitor's row; the access detail shows it.
- Can I whitelist by user agent as well?
Yes. The same three types are available under Block & Re-director > Whitelist > Whitelist user agent.
- My pattern blocks nothing. Why?
Capital and small letters count as different: gptbot does not match GPTBot. Add (?i) at the start of the pattern.
- Can I edit a pattern generated with AI?
Yes. After Use this rule it sits in Regex pattern like text you typed.
- Why does a whitelist pattern get a stronger warning?
Whitelist rules are checked before block rules, so a pattern matching every browser would let everyone through and cancel all your block rules.
Updated on: 16/10/2026
Thank you!