> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.omegatheme.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# 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?](#2-how-to-block-or-redirect-by-browser-or-device)
* [Let AI write the pattern for you](#2-let-ai-write-the-pattern-for-you)
* [How it works?](#2-how-it-works)
* [Who can use this feature?](#2-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**.

![](https://storage.crisp.chat/users/helpdesk/website/-/8/3/8/3/8383e5404a31c000/20250909-084245_24gp4e.png)

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

![](https://storage.crisp.chat/users/helpdesk/website/-/8/3/8/3/8383e5404a31c000/20250909-084419_7bjhju.png)

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](https://help.omegatheme.com/en/article/a-complete-guide-block-redirect-rules-1f1wr1i/).

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.

![](https://storage.crisp.chat/users/helpdesk/website/-/8/3/8/3/8383e5404a31c000/20250909-085040_k4xalf.png)

### 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.

![](https://storage.crisp.chat/users/helpdesk/website/-/8/3/8/3/8383e5404a31c000/20250909-085850_18hgbfp.png)

### 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](#2-let-ai-write-the-pattern-for-you)).

![](https://storage.crisp.chat/users/helpdesk/website/-/8/3/8/3/8383e5404a31c000/image_1eizy85.png)

| Tip: Patterns treat capital and small letters as different by default. Add `(?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.

![](https://storage.crisp.chat/users/helpdesk/website/-/8/3/8/3/8383e5404a31c000/image_syw16m.png)

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.

| Tip: Start with a word that matches the tab: "block" for a Block rule, "redirect" for Redirect, "allow" for Whitelist.

Step 4: Review the **Generated rule**, its **What this rule does** explanation and the **Sample user agents** badged **Matched** / **Not matched**.

![](https://storage.crisp.chat/users/helpdesk/website/-/8/3/8/3/8383e5404a31c000/screenshot-2026-08-21-at-13354_rd6fng.png)

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**.

![](https://storage.crisp.chat/users/helpdesk/website/-/8/3/8/3/8383e5404a31c000/screenshot-2026-08-21-at-13375_btct0s.png)

### 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 | `python-requests` |
| **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](#3-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

1. **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.

2. **Can I whitelist by user agent as well?**

Yes. The same three types are available under **Block & Re-director > Whitelist > Whitelist user agent**.

3. **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.

4. **Can I edit a pattern generated with AI?**

Yes. After **Use this rule** it sits in **Regex pattern** like text you typed.

5. **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.