Technical Setup

Configuring robots.txt for AI Crawlers: The Complete Guide

Published: 2026-03-2214 min readv1.0

Robots.txt file controlling access for AI search crawlers -- technical SEO illustration

Key Takeaways

  • robots.txt is the single most important file for AI visibility -- if it blocks AI crawlers, your site is invisible to ChatGPT, Gemini, Perplexity, and Claude regardless of how good your content is
  • AI bots fall into three categories: search bots (must allow), user-triggered fetchers (must allow), and training bots (optional to block) -- treating them all the same is the most common mistake
  • The recommended configuration allows search and user-triggered bots by name while selectively blocking training-only crawlers like CCBot, Bytespider, and meta-externalagent
  • Sites with fast page loads (FCP under 0.4 seconds) are cited 3x more often by ChatGPT -- robots.txt gets crawlers to your door, but speed determines whether they stay
  • Your CDN or WAF (Cloudflare, Vercel, etc.) can silently block AI bots even when robots.txt allows them -- always verify actual crawler access after making changes

Not sure if AI crawlers can reach your site? Run a free AI visibility scan -- AImetrico checks your robots.txt, CDN headers, and actual bot access in 60 seconds.

What Is robots.txt and Why It Matters for AI

A robots.txt file is a plain text file placed at the root of your website (e.g., https://example.com/robots.txt) that tells web crawlers which parts of your site they are allowed or not allowed to access. It follows the Robots Exclusion Protocol, a standard that has been in use since 1994. Every major search engine and AI platform respects it.

Here is the critical point for AI SEO: if your robots.txt blocks AI crawlers, your website is completely invisible to AI-generated answers. It does not matter how well-written your content is, how perfect your schema markup is, or how strong your domain authority is. If the crawler cannot fetch your page, you do not exist in AI search.

This is not a theoretical problem. Our analysis shows that roughly 1 in 5 business websites accidentally blocks at least one major AI search bot. Many block all of them. The cause is usually a legacy robots.txt written years ago when "bots" meant scrapers and spam crawlers, not ChatGPT delivering your next customer.

The landscape has changed. In 2024-2026, a new generation of AI crawlers appeared -- each with its own user-agent string, its own purpose, and its own rules. Some crawlers fetch pages to power real-time AI search (these you almost certainly want to allow). Others collect data to train AI models (these you may want to block). Your robots.txt needs to distinguish between them.

This guide will walk you through every AI crawler that matters, show you the exact robots.txt configuration we recommend, and help you avoid the mistakes that make websites vanish from AI results.

Diagram showing robots.txt acting as a gatekeeper between AI crawlers and website content

The Complete List of AI Crawler Bots (2026)

Not all AI bots are created equal. They fall into three distinct categories, and understanding these categories is the foundation of a correct robots.txt configuration. For a deep dive into every bot, see our complete AI crawler bots list for 2026.

Category 1: Search Bots -- MUST Allow

These bots crawl your pages to power AI search features. When a user asks ChatGPT a question and it cites your website in the answer, it was one of these bots that fetched your page. Blocking them means zero visibility in AI-generated answers.

| Bot Name | Operator | Purpose | |---|---|---| | OAI-SearchBot | OpenAI | Powers ChatGPT Search and SearchGPT results | | PerplexityBot | Perplexity | Powers Perplexity search answers and citations | | ClaudeBot | Anthropic | Powers Claude's web search and citation features | | Bingbot | Microsoft | Powers Bing, Copilot, and feeds data to ChatGPT's Bing integration | | Googlebot | Google | Powers Google Search, AI Overviews, and Gemini's grounded answers | | Applebot | Apple | Powers Siri, Apple Intelligence, and Safari Suggestions |

Rule: Allow all of these. Blocking any of them directly removes you from that platform's AI answers.

Category 2: User-Triggered Fetchers -- MUST Allow

These bots activate only when a user explicitly asks the AI to visit a specific URL or browse the web. They are not autonomous crawlers -- they act on behalf of a human user in real time. For a detailed breakdown of how these differ from search bots, read our guide on search bots vs training bots.

| Bot Name | Operator | Purpose | |---|---|---| | ChatGPT-User | OpenAI | Fetches a page when a ChatGPT user asks to browse a URL | | Claude-User | Anthropic | Fetches a page when a Claude user provides a link | | Perplexity-User | Perplexity | Fetches a page during a Perplexity user's research session |

Rule: Allow all of these. They represent a real person actively seeking your content right now. Blocking them is like refusing to answer the phone when a customer calls. For more on how OpenAI's bot family works together, see GPTBot, OAI-SearchBot, and ChatGPT-User explained.

Category 3: Training Bots -- Optional Block

These bots collect data to train or fine-tune AI models. They do not directly affect whether your site appears in AI search results today. Blocking them is a business decision: you may choose to opt out of contributing to AI training while still maintaining full AI search visibility.

| Bot Name | Operator | Purpose | |---|---|---| | GPTBot | OpenAI | Collects training data for OpenAI models | | Google-Extended | Google | Collects training data for Gemini and related models | | CCBot | Common Crawl | Builds the Common Crawl dataset used by many AI labs | | Bytespider | ByteDance | Collects data for ByteDance AI models (TikTok, Doubao) | | meta-externalagent | Meta | Collects data for Meta AI (Llama models, Meta AI assistant) |

Rule: Your choice. Blocking these bots will not affect your visibility in AI search results.

Three categories of AI crawler bots -- search bots, user-triggered fetchers, and training bots

robots.txt Syntax and Directives

Before jumping into configurations, you need to understand the syntax. A robots.txt file uses four main directives:

User-agent

Specifies which bot the following rules apply to. Use * to target all bots, or a specific name to target one.

User-agent: OAI-SearchBot

Disallow

Blocks the specified bot from accessing a path. An empty Disallow: means "allow everything."

Disallow: /admin/
Disallow: /private/

Allow

Explicitly allows access to a path, even if a broader Disallow rule would otherwise block it. This directive is essential for fine-grained control.

Allow: /blog/
Allow: /products/

Sitemap

Points crawlers to your XML sitemap. Place this at the bottom of the file, outside any User-agent block.

Sitemap: https://example.com/sitemap.xml

Key syntax rules

  1. Each User-agent line starts a new block. All Allow and Disallow lines below it apply to that bot until the next User-agent line.
  2. More specific paths take priority. Allow: /blog/ overrides Disallow: / for the /blog/ directory.
  3. The file must be at the root. https://example.com/robots.txt is correct. https://example.com/pages/robots.txt will be ignored.
  4. Case sensitivity matters for paths, not for directives. Disallow: /Admin/ and Disallow: /admin/ are different rules. But disallow: and Disallow: both work.
  5. Wildcard support varies. The * in paths (e.g., Disallow: /*.pdf$) is supported by Googlebot and most major bots, but not all AI crawlers handle wildcards identically. When in doubt, use explicit paths.
  6. Comments use #. Anything after # on a line is ignored. Use comments liberally to document your rules.

Here is a minimal example showing the basic structure:

# This is a comment
User-agent: ExampleBot
Disallow: /private/
Allow: /private/public-page/

User-agent: *
Disallow: /admin/

Sitemap: https://example.com/sitemap.xml

Is your robots.txt blocking AI crawlers?

AImetrico scans your robots.txt, CDN headers, and real bot access in one click.

Scan My robots.txt Free →

Free • No signup • Instant results

Common Mistakes That Kill AI Visibility

Based on thousands of website audits, these are the robots.txt mistakes we see most often:

Mistake 1: Blocking all bots with a blanket Disallow

# BAD: This blocks EVERYTHING
User-agent: *
Disallow: /

This single rule makes your entire website invisible to every AI search bot, every user-triggered fetcher, and every search engine. It is the nuclear option and almost never what you actually want. If you intend to block specific bots, list them by name. The * wildcard in User-agent should almost always be paired with Allow: /, not Disallow: /.

Mistake 2: Not distinguishing search bots from training bots

Many websites block GPTBot and assume they have "blocked ChatGPT." In reality, GPTBot is OpenAI's training crawler. The bots that actually power ChatGPT's search feature are OAI-SearchBot and ChatGPT-User. Blocking GPTBot while allowing OAI-SearchBot gives you the best of both worlds: no training data contribution, full search visibility. See our detailed explainer on GPTBot, OAI-SearchBot, and ChatGPT-User for the full breakdown.

Mistake 3: Using wildcards incorrectly

# BAD: Wildcard path syntax not universally supported
User-agent: OAI-SearchBot
Disallow: /blog/*.html$
Allow: /blog/

While Googlebot handles path wildcards like * and $ reliably, not all AI crawlers interpret them correctly. Some may treat *.html$ literally rather than as a pattern. Stick to explicit paths when configuring rules for AI bots. If you need complex path-based rules, test them thoroughly using the methods described in the testing section below.

Mistake 4: Forgetting that order matters (sort of)

In robots.txt, the most specific matching rule wins -- but when two rules are equally specific, different bots may interpret the conflict differently. Avoid creating contradictory rules:

# BAD: Contradictory rules for the same bot
User-agent: ClaudeBot
Disallow: /blog/
Allow: /blog/

Which rule wins? It depends on the crawler's implementation. Some bots use the last matching rule, others use the most specific, and some use the first match. Avoid ambiguity entirely by having clear, non-contradictory rules for each bot.

Mistake 5: Editing robots.txt and forgetting about CDN caching

You update your robots.txt locally, deploy it, and assume AI crawlers will see the new version immediately. But if your CDN (Cloudflare, Vercel, Fastly) caches the old robots.txt, crawlers will keep using the cached version for hours or even days. After any robots.txt change, purge the CDN cache for /robots.txt specifically. See our CDN configuration guide for AI bots for platform-specific instructions.

Mistake 6: No robots.txt file at all

If your site has no robots.txt file (returning a 404 at example.com/robots.txt), most crawlers will interpret this as "allow everything." That sounds fine -- but it means you have zero control. Any training bot can freely access your content, and you have no way to selectively block them. Always create an explicit robots.txt, even if its only rule is Allow: /.

How to Test Your robots.txt

Making changes to robots.txt without testing is like editing production code without a staging environment. Here are four methods to verify your configuration:

Method 1: Direct browser check

Open https://yourdomain.com/robots.txt in your browser. Confirm:

  • The file loads (HTTP 200, not 404 or 500)
  • The content is plain text, not HTML
  • Your intended rules are present
  • No stale cached version is showing

Method 2: Google Search Console robots.txt Tester

Google Search Console includes a robots.txt testing tool under Crawl > robots.txt Tester. While it is designed for Googlebot, you can manually change the user-agent dropdown to test rules for other bots. Enter a URL path and see whether it would be blocked or allowed.

Method 3: Fetch the page as a specific bot

Use curl with a custom User-Agent header to simulate how a specific AI crawler would see your site:

# Test as OAI-SearchBot
curl -A "OAI-SearchBot" -I https://yourdomain.com/

# Test as ClaudeBot
curl -A "ClaudeBot" -I https://yourdomain.com/

# Test as PerplexityBot
curl -A "PerplexityBot" -I https://yourdomain.com/

Look for HTTP 200 (allowed) vs HTTP 403 or 503 (blocked by WAF/CDN). Note that this tests server-level access, not robots.txt compliance -- bots voluntarily obey robots.txt, so curl will always get through. But if your WAF blocks the request at the server level, curl will reveal it.

Method 4: Use AImetrico's crawler access check

The fastest method: run a free scan at AImetrico. The scanner checks your robots.txt for all major AI bots, tests actual HTTP access from known crawler IP ranges, and flags any CDN/WAF blocks. For more testing approaches, read our guide on verifying AI crawler access to your website.

AImetrico scan showing robots.txt results for AI crawlers

CDN and WAF Considerations

Your robots.txt can be perfect, and AI crawlers can still be blocked. The problem often sits between your server and the internet: your CDN (Content Delivery Network) or WAF (Web Application Firewall).

Cloudflare

Cloudflare's Bot Fight Mode and Super Bot Fight Mode are the most common culprits. These features automatically challenge or block bot traffic -- including legitimate AI crawlers. To fix this:

  1. Go to Security > Bots in your Cloudflare dashboard
  2. Check whether Bot Fight Mode is enabled
  3. If it is, create WAF Custom Rules that allow traffic from verified AI crawler IP ranges
  4. OpenAI publishes its IP ranges at platform.openai.com/docs/bots
  5. Anthropic and Perplexity similarly publish their crawler IP documentation

Vercel

Vercel's built-in firewall can interfere with AI crawlers, especially on sites using Edge Functions. Check your vercel.json for any headers or rewrites rules that might return non-200 responses to bot user-agents. Vercel also caches robots.txt aggressively -- after changes, trigger a redeployment or clear the edge cache.

AWS CloudFront / WAF

If you use AWS CloudFront with AWS WAF, check your Web ACL rules. Default managed rule groups like AWSManagedRulesAmazonIpReputationList and AWSManagedRulesBotControlRuleSet may block AI crawler IPs. Create exceptions for known crawler IP ranges.

General CDN checklist

Regardless of which CDN you use, run through this checklist after updating your robots.txt:

  1. Purge the CDN cache for /robots.txt specifically
  2. Test with curl from an external server (not your local machine, which may bypass the CDN)
  3. Check your CDN's analytics/logs for blocked requests from AI crawler user-agents
  4. Verify that your CDN does not inject a CAPTCHA or JavaScript challenge for bot traffic

For step-by-step CDN configuration guides for each provider, see our dedicated article on configuring CDNs for AI bot access.

Diagram showing how CDN and WAF layers can block AI crawlers before they reach the origin server

Beyond robots.txt: llms.txt

Once your robots.txt is correctly configured, consider creating an llms.txt file. This is a newer standard (proposed in late 2024) that provides AI models with a structured description of your website, your most important pages, and how your content should be interpreted. Think of it as a "cover letter" for AI crawlers that goes beyond access rules into content guidance. Our complete guide to the llms.txt specification walks you through the format and implementation.

The connection to performance

Allowing crawlers access is step one. Step two is making sure they can actually load your pages fast enough to use them. Research shows that sites with a First Contentful Paint (FCP) under 0.4 seconds are cited by ChatGPT 3x more often than slower sites. AI crawlers operate under strict time budgets -- if your page takes too long to render, the crawler moves on to a faster source. Make sure your semantic HTML is clean and your server response times are low. And of course, make sure your JSON-LD structured data is present so crawlers can parse your content quickly once they do access it.

Frequently Asked Questions

Does robots.txt actually stop AI from using my content?

Robots.txt controls crawling, not training. If your content was already scraped before you added a block, it may still exist in a model's training data. However, robots.txt does control whether AI search bots like OAI-SearchBot and PerplexityBot can fetch your pages in real time to cite them in responses. Blocking these bots means your site will not appear in live AI-generated answers.

Should I block GPTBot in robots.txt?

It depends on your goals. GPTBot is primarily OpenAI's training data collector. Blocking it will prevent your content from being used to train future OpenAI models. However, blocking GPTBot alone will NOT prevent your site from appearing in ChatGPT search results -- that is handled by OAI-SearchBot and ChatGPT-User, which are separate bots. Most sites benefit from blocking GPTBot while allowing OAI-SearchBot and ChatGPT-User.

What is the difference between OAI-SearchBot and ChatGPT-User?

OAI-SearchBot is OpenAI's dedicated search crawler that proactively fetches pages for ChatGPT's search feature and AI-generated answers. ChatGPT-User is the bot that fetches pages when a user explicitly asks ChatGPT to browse a specific URL. Both are user-triggered (not training) bots. You should allow both if you want visibility in ChatGPT responses. For a thorough comparison, see GPTBot, OAI-SearchBot, and ChatGPT-User explained.

How often do AI crawlers check my robots.txt?

Most AI crawlers cache your robots.txt for approximately 24 hours, though some may re-fetch it more frequently. After updating your robots.txt, expect changes to take effect within 24-48 hours for most AI platforms. Google-Extended and Googlebot typically re-check within a few hours due to Google's more frequent crawl cycle. To speed up propagation, purge your CDN cache for /robots.txt after every change.

Can I allow AI search bots but block AI training bots?

Yes, and this is exactly what we recommend. Because AI search bots and training bots use different user-agent strings, you can create separate robots.txt rules for each. Allow OAI-SearchBot, ChatGPT-User, PerplexityBot, Perplexity-User, ClaudeBot, and Claude-User (search and browsing). Block GPTBot, Google-Extended, CCBot, Bytespider, and meta-externalagent (training). This gives you full AI search visibility with no training data contribution.

Does blocking AI crawlers in robots.txt affect my Google rankings?

No. Blocking AI-specific crawlers like GPTBot, ClaudeBot, or PerplexityBot has zero effect on your Google rankings. Google uses Googlebot for indexing and ranking -- a completely separate bot. Google-Extended is used only for Gemini AI training and does not affect Google Search rankings. However, be extremely careful not to accidentally block Googlebot while editing your robots.txt -- that mistake will tank your Google rankings within days.

My site uses Cloudflare. Do I need to do anything extra for AI crawlers?

Yes. Cloudflare's Bot Fight Mode and Super Bot Fight Mode can block AI crawlers at the network level, even if your robots.txt explicitly allows them. The symptoms are subtle: your robots.txt looks correct, but AI crawlers receive a 403 Forbidden or a JavaScript challenge they cannot solve. You need to create WAF custom rules that whitelist verified AI crawler IP ranges. OpenAI, Anthropic, and Perplexity all publish their crawler IP ranges publicly. See our CDN configuration guide for AI bots for step-by-step Cloudflare instructions.

Is your robots.txt costing you AI visibility?

AImetrico checks your robots.txt, CDN headers, page speed, and actual AI crawler access -- all in one free scan.

Scan My Website Free →

Trusted by 2,400+ websites • No credit card required

robots.txt AI crawlersGPTBot robots.txtAI crawler botsOAI-SearchBotPerplexityBotChatGPT-UserClaudeBotrobots.txt configuration

Related Articles

Complete List of AI Crawler Bots (2026): Every Bot You Need to Know

10 min read

GPTBot vs OAI-SearchBot vs ChatGPT-User: What's the Difference?

8 min read

Search Bots vs Training Bots: Which AI Crawlers to Allow and Block

9 min read