How to Allow or Block AI Bots from Crawling Your Site

Author: Clara WestinPublished: Aug 21, 2026Updated: Aug 21, 202611 min read

Learn the technical methods to manage AI bot access using robots.txt directives, HTTP headers, and WAF rules to protect site data and control LLM training ingestion.

Featured image for How to Allow or Block AI Bots from Crawling Your Site
Featured image for How to Allow or Block AI Bots from Crawling Your Site

Managing the access of artificial intelligence (AI) crawlers is a critical architectural requirement for modern web properties seeking to protect proprietary data while maintaining search visibility. As Large Language Models (LLMs) expand, technical decision-makers must proactively design policies to allow or block AI bots from crawling your site. This operational guide provides enterprise-grade implementations utilizing robots.txt directives, custom HTTP headers, and Web Application Firewall (WAF) configurations. By mastering these protocols, organizations can prevent unauthorized LLM ingestion, secure intellectual property, optimize server bandwidth, and strategically manage how their digital assets interact with the rapidly evolving generative search ecosystem.

The Strategic Imperative of Managing AI Web Crawlers

Distinguishing Between AI Search Crawlers and LLM Training Bots

Webmasters must recognize that not all artificial intelligence agents serve the same purpose. Broadly, AI web crawlers fall into two distinct operational categories: real-time search crawlers and offline foundation model training bots. Real-time search crawlers, such as those powering Perplexity AI or active user sessions in ChatGPT-User, fetch live web pages to answer immediate user queries. These engines require instant access to updated content to provide accurate attribution and send referral traffic back to the source domain.

Conversely, offline Large Language Model (LLM) training bots, like GPTBot or CCBot, harvest data in bulk. This information is ingested into massive datasets to train neural networks. These training runs do not yield direct referral traffic or real-time citations. Ingested data becomes part of the model’s static knowledge base, meaning the original publisher receives no subsequent direct clicks or visibility when a user queries the model.

Distinguishing between these two crawler types is critical for establishing an effective digital product strategy. Blocking all bots indiscriminately protects proprietary assets but eliminates visibility in generative AI search engines (GEO). Strategic access management requires configuring different rules for real-time discovery and bulk data ingestion.

Allowing unmonitored AI scrapers to index your digital infrastructure presents several operational, financial, and legal challenges. From an infrastructure perspective, aggressive autonomous agents can consume substantial server bandwidth optimization resources. Unlike traditional search engines that crawl at predictable intervals, unthrottled AI scraping bots can execute high-frequency, parallel requests, leading to server latency or unexpected hosting costs for high-traffic platforms.

From a intellectual property protection standpoint, wholesale data scraping mitigation has become a primary concern for content publishers, SaaS platforms, and enterprise databases. When proprietary documentation, creative assets, or localized research are ingested into LLMs, the unique competitive advantage of that data is diluted. This has fueled global debates around copyright infringement and licensing models.

Additionally, data privacy regulations like GDPR and CCPA present compliance risks. If your website displays user-generated content or public profile directories, allowing training bots to copy this data can lead to regulatory issues regarding the "right to be forgotten" and automated processing of personal information.

Identifying the Primary AI Bot User-Agents

OpenAI Directives: GPTBot and ChatGPT-User

OpenAI deploys two main User-Agent strings, each corresponding to a different system. The primary web crawler used to gather training data for GPT-4 and subsequent iterations is named GPTBot. This bot respects standard robots.txt directives and originates from documented IP ranges. Implementing block rules specifically for GPTBot prevents OpenAI from using your site's data in future model training cycles.

# Example User-Agent string for GPTBot
Mozilla/5.0 (compatible; GPTBot/1.2; +https://openai.com/gptbot)

The second user agent is ChatGPT-User. This agent is triggered when a user explicitly requests ChatGPT to fetch live web content, browse the web, or run custom GPT actions. Blocking ChatGPT-User prevents end-users from interacting with your real-time data through ChatGPT, which can limit the utility of custom applications.

# Example User-Agent string for ChatGPT-User
Mozilla/5.0 (compatible; ChatGPT-User/1.0; +https://openai.com/chatgpt-user)

Google Directives: Google-Extended vs. Standard Googlebot

Google provides webmasters with a distinct opt-out mechanism called Google-Extended. This token allows site administrators to manage whether their content is used to train Google’s Gemini and Vertex AI models. Crucially, opting out via Google-Extended does not impact standard search visibility.

# Target token for Google's AI training models
User-agent: Google-Extended

Standard web indexing, search result generation, and real-time citations in Google's AI Overviews are managed by traditional crawlers, primarily Googlebot and its mobile counterpart. To maintain visibility in standard search and AI Overviews, you must keep Googlebot allowed while selectively blocking Google-Extended if you wish to prevent model training.

Anthropic and Others: ClaudeBot, CCBot, and Perplexity

Anthropic uses the ClaudeBot user-agent to collect web data for its Claude model family. It is important to note that Anthropic's crawler may attempt to read websites from various cloud hosting IP blocks.

# Target token for Anthropic AI
User-agent: ClaudeBot

Another major crawler is CCBot, operated by the Common Crawl foundation. Common Crawl provides open-source web datasets used by many independent AI companies and research institutions to train LLMs. Blocking CCBot prevents your site from being included in these widely distributed datasets.

Other search engines, such as @@CODE0@@ and @@CODE1@@, also use unique user-agent strings. Perplexity relies on several agents, including its own PerplexityBot, while Apple uses Applebot-Extended to govern data collection for Apple Intelligence without affecting traditional search indexing.

# Examples of other prominent AI tokens
User-agent: CCBot
User-agent: PerplexityBot
User-agent: Applebot-Extended

Method 1: Implementing Robots.txt Directives (Courtesy Protocol)

How to Blanket-Block All AI Training Bots

The most common way to manage crawl permissions is through the robots exclusion protocol. To block most mainstream AI training bots from accessing your entire website, you can list their user-agent tokens individually in your robots.txt file and set the Disallow directive to the root directory.

User-agent: GPTBot
Disallow: /

User-agent: Google-Extended
Disallow: /

User-agent: ClaudeBot
Disallow: /

User-agent: CCBot
Disallow: /

User-agent: Omgilibot
Disallow: /

User-agent: Applebot-Extended
Disallow: /

This configuration systematically blocks these specific training crawlers. It is important to define these rules for each individual user-agent, as generic wildcard rules like User-agent: * can impact traditional search engines like Googlebot and Bingbot, which you likely want to keep allowed.

How to Selectively Allow Specific AI Bots

For sites that want to opt-out of model training but remain visible in real-time generative search answers, a hybrid robots.txt configuration is necessary. This setup allows search-oriented agents to crawl while blocking training bots.

# Block bulk model training ingestion
User-agent: GPTBot
Disallow: /

User-agent: Google-Extended
Disallow: /

# Allow real-time search discovery and citations
User-agent: ChatGPT-User
Allow: /

User-agent: PerplexityBot
Allow: /

This configuration prevents OpenAI from training its models on your content, while still allowing ChatGPT users to fetch live pages and Perplexity AI to index your site for real-time citations.

Limitations of the Robots Exclusion Standard

While robots.txt is the industry standard, it operates as a voluntary protocol. Well-known technology firms like Google, Microsoft, OpenAI, and Anthropic generally respect these rules, but bad actors, rogue scrapers, and certain startup aggregators may ignore them entirely.

Additionally, robots.txt files are publicly readable. Anyone can inspect your /robots.txt directory to identify which folders you are attempting to hide, making it a poor choice for securing confidential or sensitive data. For stronger security, robots.txt should be paired with server-level access management and firewall rules.

PROCESS STEPS

Steps to Configure and Deploy Robots.txt Directives

Follow this sequence to establish a standard robots exclusion policy.

01

Audit current crawlers

Review your server access logs to identify active AI user-agents and their crawl frequencies.

02

Draft the robots.txt directives

Create or edit your site's robots.txt file in the root directory, adding targeted User-agent blocks.

03

Validate and deploy

Test the syntax using robots.txt testing tools, upload to the live server, and monitor search console dashboards.

Method 2: Utilizing HTTP Headers for Granular Control

Configuring the X-Robots-Tag for Specific Web Pages

When you need page-level control rather than sitewide blocking, the X-Robots-Tag HTTP header is an effective option. This header is sent from your web server to the crawler's request, instructing it how to handle the page's content.

To instruct search and AI indexers not to index a specific URL, configure your web server to return the following HTTP header:

X-Robots-Tag: noindex, nofollow

This header is highly reliable because it is embedded directly in the HTTP response. Unlike HTML meta tags, it can be applied to non-HTML documents, making it highly versatile.

Applying HTTP Headers for PDF and Non-HTML Asset Protection

Many websites host valuable resources like PDF whitepapers, Excel templates, and eBooks, which are highly sought after by LLM training datasets. Because these files lack HTML heads, standard <meta name="robots" content="noindex"> tags cannot protect them.

You can apply the X-Robots-Tag dynamically to these file types using server configuration files like Nginx or Apache.

For Nginx, add the following block to your site's configuration file:

location ~* \.(pdf|docx|xlsx|csv)$ {
    add_header X-Robots-Tag "noindex, noarchive, nosnippet";
}

For Apache, add this rule to your .htaccess file:

<FilesMatch "\.(pdf|docx|xlsx|csv)$">
    Header set X-Robots-Tag "noindex, noarchive, nosnippet"
</FilesMatch>

These directives prevent crawlers from indexing, archiving, or displaying snippets of these documents in search and AI results.

Method 3: Enforcing Access via Web Application Firewalls (WAF)

Why WAF Rules are Necessary for Rogue AI Scrapers

Rogue scrapers often spoof their User-Agent strings, pretending to be standard desktop browsers (like Google Chrome) to bypass robots.txt limits. Relying solely on robots.txt leaves your site open to these aggressive collectors.

A Web Application Firewall (WAF) provides a stronger defense by analyzing incoming traffic patterns, IP addresses, and request behaviors. If an agent makes high-frequency requests across multiple pages in a short period, the WAF can block or challenge the request with a CAPTCHA, regardless of its declared user-agent.

Configuring Cloudflare and Enterprise WAF Solutions to Block AI Traffic

Cloudflare and other enterprise WAF providers offer automated solutions to manage AI traffic. Cloudflare features a "Block AI Bots" toggle that blocks known AI crawlers with a single click.

For more granular control, you can create custom WAF rules using Cloudflare’s Expressions:

(http.user_agent contains "GPTBot") or 
(http.user_agent contains "ClaudeBot") or 
(http.user_agent contains "CCBot") or 
(http.user_agent contains "Omgilibot")

When this rule is triggered, the WAF can execute a "Block" or "JS Challenge" action. This stops the crawler at the network edge, protecting your server resources.

Server-Level Blocking via Nginx and Apache Configurations

If you do not use a cloud WAF, you can implement server-level block rules directly within your hosting environment.

For Nginx, edit your block configuration file to return a 403 Forbidden status code for specific user-agents:

map $http_user_agent $is_ai_bot {
    default 0;
    ~*GPTBot 1;
    ~*ClaudeBot 1;
    ~*CCBot 1;
    ~*Omgilibot 1;
}

server {
    listen 80;
    server_name example.com;

    if ($is_ai_bot) {
        return 403;
    }
}

For Apache servers, add these rules to your .htaccess file:

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^.*(GPTBot|ClaudeBot|CCBot|Omgilibot).*$ [NC]
RewriteRule ^(.*)$ - [F,L]

These rules reject targeted crawler traffic directly at the server level, preserving bandwidth and protecting your site's data.

The SEO Impact of AI Bot Management

Balancing Intellectual Property Protection with AI Search Visibility

Deciding whether to block AI bots is not a simple choice; it involves balancing data protection with digital visibility. As generative search platforms like Perplexity, ChatGPT Search, and Google AI Overviews grow, they represent new traffic channels.

If you block all crawlers, your content cannot be cited in these real-time search engines. This means your brand may miss out on emerging traffic sources. High-value data publishers should weigh the risks of model training against the benefits of real-time search traffic when designing their crawler policies.

Ensuring Traditional Search Engine Crawlers Remain Unaffected

When configuring crawler blocks, it is vital to ensure your rules do not interfere with standard search engine optimization (SEO) efforts.

Traditional indexing bots, such as @@CODE0@@ and @@CODE1@@, must retain full access to your site. Ensure that your wildcard patterns and global block rules are tested thoroughly to prevent accidental de-indexing of your web properties.

Auditing and Verifying Your Crawler Defenses

Monitoring Server Logs for Unauthorized User-Agents

Deploying configurations is only half the battle; you must verify that your defenses are working. The most reliable way to do this is by regularly inspecting your raw server access logs. Look for requests from known bot user-agents and check the response status codes.

You can use the command line to quickly check your Nginx or Apache access logs for AI bot traffic:

grep -i "GPTBot" /var/log/nginx/access.log | tail -n 20

Verify that these requests return an HTTP @@CODE0@@ or @@CODE1@@ as configured, rather than a successful 200 OK.

Testing Your Robots.txt and HTTP Header Configurations

You can test your site's responses using command-line tools like curl. This allows you to verify that your configurations behave as expected under different user-agent requests.

To test your robots.txt response:

curl -I -A "GPTBot" https://example.com/

Check the HTTP headers in the response. If you configured server-level blocking for GPTBot, you should receive a 403 Forbidden status code.

Additionally, use Google Search Console's Robots.txt Tester and other developer tools to verify that your rules are syntactically correct and do not block traditional search crawlers.

CHECKLIST

Verification Checklist for AI Bot Management

Execute these quality-assurance steps to confirm your blocking strategies are fully operational.

01

Verify robots.txt syntax

Use an online robots parser to ensure no formatting syntax breaks your standard SEO indexing.

02

Run curl tests

Emulate user-agents like GPTBot or ClaudeBot via command line to confirm your server or WAF serves a 403 Forbidden or block response.

03

Analyze real-time server logs

Check logs post-deployment to verify that targeted crawler traffic has dropped or is successfully blocked at the edge.

Frequently Asked Questions

Does robots.txt legally protect my site content from AI ingestion?

No, robots.txt is a technical protocol rather than a legally binding agreement. While reputable AI companies comply with it, rogue scrapers and some third-party data aggregators can easily bypass these rules without facing immediate technical barriers.

Can I block AI scrapers without harming my traditional SEO performance?

Yes, by targeting specific user-agent strings like GPTBot or using Google-Extended, you can block generative AI training while allowing traditional search crawlers like Googlebot and Bingbot to index your site for standard search results.

How frequently do AI bot User-Agents change?

AI vendors update their user-agent strings and introduce new crawlers regularly as their models evolve. It is recommended to perform quarterly audits of your server logs to identify and block new or modified scraper signatures.

What is the difference between GPTBot and ChatGPT-User?

GPTBot is an autonomous crawler used wholesale to scrape web content to train future foundation models. ChatGPT-User is a real-time, user-triggered agent that fetches live web pages specifically when a user asks ChatGPT to browse the web for a current query.

Does blocking Google-Extended prevent my site from appearing in Google AI Overviews?

No, Google-Extended controls whether your content is used to train Google’s Gemini and Vertex AI models. Traditional Googlebot still crawls and indexes your site, which means you can still appear in Google Search and AI Overviews.

How does a Web Application Firewall protect my site better than robots.txt?

A Web Application Firewall operates at the network edge, allowing you to active-block requests using IP reputation, behavioral heuristics, and strict user-agent rules, whereas robots.txt is completely voluntary and easily ignored by malicious bots.

Should e-commerce sites block AI crawlers?

E-commerce businesses should balance risk and reward; while blocking training bots prevents copycats from scraping product catalogs, blocking search-focused bots may reduce visibility in generative shopping recommendations and product search engines.

Can I block AI bots on specific high-value folders only?

Yes, you can use robots.txt Disallow directives or conditional X-Robots-Tag HTTP headers configured specifically for high-value directories, premium content assets, API endpoints, or database structures to ensure targeted protection.

Final Step

Launch your U.S. company with a structured execution plan

Use guided tools, operational support, and document workflows from one platform.

How to Allow or Block AI Bots from Crawling Your Site | Webizm