Are you an agent? View this page in Markdown.Read our AI instructions.
  • Pricing
  • Docs
  • Blog
  • Changelog
  • Agent Picks runner on GitHub
  • AI Search
  • Visibility
  • Response accuracy
  • Brand positioning
  • AI Traffic
  • Actions
  • Results
  • Agents
  • API & MCP
  • Agent Picks
  • Pick rate
  • Agent Experience
  • Why agents leave
  • Fixes and re-tests
  • Agent runs
  • Local Runner
  • How we test
  • State of AI Search for Dev Tools
  • Developer tool AI search landscape
  • Leaderboards
Sign InSign Up

Make AI describe you the way you'd describe yourself.

Start free trial

No card required

Get recommended by AI search and coding agents.

Product

  • Results
  • How we test
  • Landscape
  • Integrations
  • AI agent directory
  • Free AI visibility checker
  • AI robots.txt checker
  • Pricing
  • FAQ
  • AI instructions

Compare

  • Compare DevTune
  • Peec AI alternatives
  • Profound alternatives
  • OtterlyAI alternatives
  • Profound vs Peec AI
  • DevTune vs Peec AI
  • DevTune vs Profound
  • DevTune vs OtterlyAI
  • DevTune vs Semrush
  • DevTune vs Ahrefs

About & resources

  • About DevTune
  • Free AI search tools
  • Blog
  • Best AI visibility tools
  • Coding agent visibility tools
  • AI visibility APIs, MCP & webhooks
  • Contact
  • Press kit

Legal

  • Terms of Service
  • Privacy Policy
  • Cookie Policy

© Copyright 2026 DevTune. All Rights Reserved. PLGeek Ltd, registered in England and Wales, company number 14492509. Registered office: C/O Aardvark Accounting, 1 Cedar Office Park, Cobham Road, Wimborne, BH21 7SB.

Are you an agent? View this page in Markdown.Read our AI instructions.
Blog

robots.txt for AI Search Crawlers: Allow ChatGPT, Claude and Perplexity, Block Training

Copy-paste robots.txt templates that keep your pages in ChatGPT, Claude and Perplexity answers while opting out of GPTBot, ClaudeBot, CCBot and Bytespider, plus the CDN and WAF rules that override robots.txt.

Dec 4, 2026·Ben WilliamsThe Product-Led Geek · CEO, DevTune
On this page+−
  1. Search, user-triggered and training crawlers
  2. Template 1: allow AI search, block training
  3. Template 2: allow every AI crawler
  4. The grouping rule that breaks hand-written files
  5. Check the file, then check the response
  6. Your CDN can block what robots.txt allows
  7. Confirm crawlers arrive

Each AI company runs separate crawlers for search, for user-triggered fetches and for model training, and each one reads its own line in robots.txt. That lets you stay in ChatGPT, Claude and Perplexity answers while opting out of training. This guide covers which token does what, two templates to copy, the grouping rule that breaks most hand-written files, and the CDN and firewall settings that block AI crawlers even when robots.txt allows them.

Search, user-triggered and training crawlers

KindWhat it doesTokens
Search crawlerIndexes pages so an AI platform can find and cite them in answersOAI-SearchBot, Claude-SearchBot, PerplexityBot, Googlebot, Bingbot
User-triggered fetcherFetches one page while it answers a person's question, often a page it will citeChatGPT-User, Claude-User, Perplexity-User
Training crawlerCollects pages that may be used to train modelsGPTBot, ClaudeBot, CCBot, Bytespider, Meta-ExternalAgent
Training control tokenNot a crawler: tells an operator whether it may train on pages its search crawler fetchedGoogle-Extended, Applebot-Extended

By operator:

  • OpenAI. OAI-SearchBot indexes pages for ChatGPT search. ChatGPT-User fetches a page when a ChatGPT user or a GPT asks for it. GPTBot collects training data. Blocking GPTBot does not remove you from ChatGPT answers.
  • Anthropic. Claude-SearchBot indexes pages for Claude's search results. Claude-User fetches a page when a Claude user asks a question that needs it. ClaudeBot collects training data.
  • Perplexity. PerplexityBot indexes the pages Perplexity links in its answers. Perplexity-User fetches a page when a Perplexity user asks for it.
  • Google. Googlebot crawls for Google Search, including AI Overviews and AI Mode. Google-Extended controls whether Google uses those pages to train Gemini and ground Gemini app answers. Google Search and AI Overviews ignore it.
  • Microsoft. Bingbot crawls for Bing search and Microsoft Copilot.
  • Others. CCBot builds the Common Crawl dataset, which many models train on. Bytespider collects pages for ByteDance. Meta-ExternalAgent collects pages Meta uses to train AI models. Applebot-Extended controls whether Apple trains on pages Applebot crawled.

The AI agent directory describes each crawler and fetcher DevTune tracks: who runs it, what it does on your site and whether a request can be checked as really coming from it.

User-triggered fetchers follow robots.txt less reliably than the rest. OpenAI says robots.txt may not apply to ChatGPT-User, and Perplexity says Perplexity-User generally ignores it. Treat a Disallow for those two as a request, not a block.

Template 1: allow AI search, block training

This whole file keeps your pages open to every search crawler and user-triggered fetcher above and opts out of the training crawlers.

User-agent: OAI-SearchBot
User-agent: ChatGPT-User
User-agent: Claude-SearchBot
User-agent: Claude-User
User-agent: PerplexityBot
User-agent: Perplexity-User
User-agent: Googlebot
User-agent: Bingbot
Disallow: /admin/
Disallow: /api/

User-agent: GPTBot
User-agent: ClaudeBot
User-agent: Google-Extended
User-agent: Applebot-Extended
User-agent: Meta-ExternalAgent
User-agent: CCBot
User-agent: Bytespider
Disallow: /

User-agent: *
Disallow: /admin/
Disallow: /api/

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

Replace the two Disallow paths in the first and last groups with your own, and the Sitemap line with your sitemap's full URL. The first group repeats the * rules because of the grouping rule below. If the first group should read everything, give it Allow: / in place of the Disallow lines.

Decide on Google-Extended separately. Blocking it opts you out of Gemini training, and it also stops Gemini apps grounding answers in your pages. If Gemini answers matter to you, move Google-Extended into the first group.

Template 2: allow every AI crawler

If you want maximum reach and don't mind your pages in training data, the simplest file allows everything:

User-agent: *
Disallow: /admin/
Disallow: /api/

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

Every crawler without its own group follows User-agent: *. A missing robots.txt that returns 404 or 410 also counts as permission to crawl everything under RFC 9309, the robots.txt standard, but an explicit file lets you add a Sitemap line and change your mind later.

The grouping rule that breaks hand-written files

Under RFC 9309, a crawler combines every group that names its token, and reads User-agent: * only when no named group matches it. That means a crawler with any group of its own ignores every * rule.

So this file looks like it keeps GPTBot out of /admin/ and lets it read the rest. It doesn't:

User-agent: *
Disallow: /admin/

User-agent: GPTBot
Allow: /blog/

GPTBot reads only the groups that name it—here just Allow: /blog/—and ignores the * group, so /admin/ is open to it. If you give a crawler its own group, copy every * rule it should still follow into a group that names it. That is why Template 1 repeats the * rules in its first group.

Two more mistakes come up often:

  • Company name instead of a token. User-agent: OpenAI or User-agent: Anthropic matches no crawler. Each crawler looks only for its own token.
  • Path case. Paths are case-sensitive: Disallow: /Docs/ doesn't block /docs/.

Check the file, then check the response

Paste your domain into the AI crawler robots.txt checker. It reads your live file with the same RFC 9309 matching crawlers use, shows each crawler's result for your site root with the rule that decides it, flags crawlers that are allowed at the root but blocked on some paths, and writes an allow-search, block-training fix and an allow-everything fix that keep your current rules.

The checker also reads how robots.txt itself responds, because the status changes what crawlers do:

robots.txt returnsWhat crawlers do
200 with rulesFollow the rules
404 or 410Crawl everything
Another 4xx, such as 403Treat it as no rules, though a firewall that refuses this request probably refuses the crawler's page requests too
429, 5xx or a timeoutTreat the whole site as blocked until the file loads
An HTML pageFind no rules in it

Google reads only the first 500 KiB of robots.txt. Rules past that point are ignored.

Your CDN can block what robots.txt allows

robots.txt is a request that crawlers choose to honour. Your CDN, WAF and bot protection make the decision that sticks. Bot-fight modes, managed challenge rules, rate limits and "block AI bots" toggles answer AI crawlers with a 403, a 429 or a JavaScript challenge, and none of that shows up in robots.txt.

Fetch a real page as the crawlers do with the AI crawler preview. It requests the page as OAI-SearchBot, PerplexityBot, Claude-SearchBot and Googlebot, and shows the status each one got, the title, description, canonical and robots tags, and the text a crawler that runs no JavaScript reads. A 403 or 429 for one bot and a 200 for another usually points at a WAF rule matched on user agent.

To fix one:

  1. Find the rule that matched in your CDN or WAF's security event log, filtered by the crawler's user agent.
  2. Add an allow or skip rule for the search crawlers and user-triggered fetchers you want, above the rule that blocked them.
  3. Match on the operator's published IP ranges as well as the user agent, so a scraper that copies the OAI-SearchBot string doesn't get through with it. OpenAI, Anthropic, Perplexity, Google and Bing each publish theirs as a JSON list, such as https://openai.com/searchbot.json.
  4. Confirm in your CDN or WAF logs that real requests from the operator's published IPs now return 200. The AI crawler preview sends requests from DevTune's servers with the crawler's user agent rather than the operator's IP range, so a working IP-restricted rule will still answer the preview with a 403—don't drop the IP check to make the preview return 200. Use the preview to check user-agent-only blocks and server-rendered HTML, and your CDN logs to confirm IP-verified crawler access.

To enforce a training block, do the reverse: deny GPTBot, ClaudeBot, CCBot and Bytespider at the CDN as well as in robots.txt.

Confirm crawlers arrive

robots.txt and the crawler preview show what a crawler would get. They don't show whether one visited, how often or which pages it fetched. For that you need your server or CDN logs, read by user agent. How to track AI crawler and answer-fetch traffic covers the filters for Cloudflare, Vercel and Nginx, and how DevTune's AI Traffic counts answer fetches, crawls and referrals separately.

Related posts

  • How to Track AI Crawler and Answer-Fetch Traffic in Cloudflare, Vercel and NginxDec 4, 2026
  • Generative Engine Optimization Services for Developer Tool CompaniesAug 23, 2026
  • AI Visibility Checkers: 5 Free Tools ComparedMay 17, 2026
Are you an agent? View this page in Markdown.Read our AI instructions.
Sign InSign Up
Are you an agent? View this page in Markdown.Read our AI instructions.