Guide

robots.txt for AI Crawlers: Allow and Deny Recipes

Three recipes and a bot-by-bot table for controlling GPTBot, ClaudeBot, PerplexityBot and the rest from one small text file.

By WebDoctor editors·22 July 2026·4 min read


To control AI crawlers, add User-agent and Disallow rules to the robots.txt file at your domain root. You can block every AI bot, block training but keep AI search, or allow all. The file is advisory: well-behaved bots obey it, but it is not access control.

How robots.txt controls AI crawlers

Each AI company ships one or more named agents. You target them by their user-agent token in robots.txt, then decide what they may fetch. There are three moves worth knowing: block a bot entirely, block only the training crawlers while letting the AI search bots through, or leave everything open. The recipes below cover all three. Every one belongs in a single file at https://example.com/robots.txt.

Recipe 1: block all AI crawlers

This denies every documented AI agent and adds the two opt-out tokens that govern training use. Paste it as-is, or trim the bots you do not care about:

User-agent: GPTBot
Disallow: /

User-agent: OAI-SearchBot
Disallow: /

User-agent: ChatGPT-User
Disallow: /

User-agent: ClaudeBot
Disallow: /

User-agent: Claude-User
Disallow: /

User-agent: PerplexityBot
Disallow: /

User-agent: Perplexity-User
Disallow: /

User-agent: CCBot
Disallow: /

User-agent: Bytespider
Disallow: /

User-agent: Google-Extended
Disallow: /

User-agent: Applebot-Extended
Disallow: /

One caveat worth stating plainly: blocking GPTBot stops OpenAI's training crawler, not ChatGPT search (that is OAI-SearchBot) and not user-triggered browsing (that is ChatGPT-User). The recipe above covers all three, which is why each gets its own block.

Recipe 2: allow AI search but block AI training

A common goal is to stay visible in AI answer engines while keeping your content out of model training. Allow the search bots, disallow the training crawlers and the training tokens:

# Allow AI search engines
User-agent: OAI-SearchBot
Allow: /

User-agent: PerplexityBot
Allow: /

# Block AI training
User-agent: GPTBot
Disallow: /

User-agent: ClaudeBot
Disallow: /

User-agent: CCBot
Disallow: /

User-agent: Google-Extended
Disallow: /

User-agent: Applebot-Extended
Disallow: /

Google-Extended and Applebot-Extended are the key to this split. They are robots.txt tokens, not separate crawlers. Disallowing them opts your content out of Gemini and Apple AI training while Googlebot and Applebot keep indexing you for normal search.

Recipe 3: allow everything (the default)

If you took nothing, this is the effective state. An empty Disallow lets every crawler fetch every path:

User-agent: *
Disallow:

A missing robots.txt file means the same thing. You only need explicit rules when you want to restrict something.

The 11 AI crawlers, compared

BotCompanyPurposeBlock to stop…
GPTBotOpenAICrawls to train modelsTraining on your content
OAI-SearchBotOpenAIPowers ChatGPT search resultsAppearing in ChatGPT search
ChatGPT-UserOpenAIUser-triggered browsing and actionsUser-initiated fetches from ChatGPT
ClaudeBotAnthropicCrawls to train modelsTraining on your content
Claude-UserAnthropicUser-triggered fetchesUser-initiated fetches from Claude
PerplexityBotPerplexityIndexes for its answer engineIndexing in Perplexity
Perplexity-UserPerplexityUser-triggered fetchesUser-initiated fetches from Perplexity
Google-ExtendedGoogleToken controlling Gemini/Vertex AI training useContent use for Gemini/Vertex AI training
Applebot-ExtendedAppleToken controlling Apple AI training useContent use for Apple AI training
CCBotCommon CrawlBuilds a public dataset used for AI trainingInclusion in the Common Crawl dataset
BytespiderByteDance (TikTok)AI crawlerByteDance AI crawling

What robots.txt can and cannot do

A few rules decide whether your file works at all:

  • It must sit at the domain root. Crawlers read https://example.com/robots.txt and nowhere else. A file in a subfolder is ignored, and every subdomain needs its own.
  • The token is case-insensitive. GPTBot and gptbot match the same crawler. Keep the documented casing for readability, but do not worry about an exact match.
  • Some entries are tokens, not crawlers. Google-Extended and Applebot-Extended never fetch anything. They only signal whether Google and Apple may use already-crawled content for AI training.
  • It is advisory, not a wall. robots.txt is voluntary. Reputable bots honor it; it is not access control and will not stop a crawler that chooses to ignore it. For hard blocking, use firewall rules, authentication, or edge blocking by user agent and IP.

Pair it with an llms.txt file

robots.txt decides who may crawl. An llms.txt file does the opposite job: it points AI systems at the content you want them to read and understand. The two work together, and you can build one with the llms.txt generator. To see how your whole site looks to AI crawlers, run the AI readiness check.

robots.txtAI crawlers

Frequently asked questions

Does blocking GPTBot remove me from ChatGPT?
No. GPTBot only handles training crawls. ChatGPT search results come from OAI-SearchBot, and user-triggered browsing uses ChatGPT-User. To stay out of ChatGPT search, disallow OAI-SearchBot as well. Each OpenAI agent is a separate token, so blocking one does not block the others.
What is the difference between Google-Extended and Googlebot?
Googlebot crawls pages for normal Search indexing. Google-Extended is a robots.txt token, not a separate crawler, that controls whether your content trains Gemini and Vertex AI. Disallow Google-Extended to opt out of AI training while your pages stay indexed in Google Search.
Is robots.txt enough to stop AI scraping?
No. robots.txt is advisory. Well-behaved crawlers honor it, but it is not access control and cannot stop a bot that ignores the rules. For a hard block, use server-side controls like firewall rules, authentication, or user-agent and IP blocking at the edge.
Where does the robots.txt file go?
At your domain root, reachable at https://example.com/robots.txt. A file in a subfolder is ignored, and every subdomain and scheme needs its own. User-agent tokens are case-insensitive, so GPTBot and gptbot match, but keep the documented casing for clarity.
Can I block AI crawlers but keep normal search?
Yes. Normal search crawlers like Googlebot and Applebot are separate from the AI training tokens. Disallow Google-Extended and Applebot-Extended to opt out of AI training while Googlebot and Applebot keep indexing your site for regular search results.

Run a check

Keep reading