Configure robots.txt for AI crawlers
Short answer
Treat search crawlers and training crawlers as separate decisions. Blocking a search crawler such as OAI-SearchBot removes you from that product's answers; blocking a training token such as GPTBot or Google-Extended does not affect search inclusion.
Before you start
Section titled “Before you start”- You can edit and deploy
/robots.txtfor every host you care about. - You know whether your CDN or WAF also blocks bots. Google notes that crawling must be allowed “by any CDN or hosting infrastructure”, not just robots.txt.
1. Decide per purpose
Section titled “1. Decide per purpose”| Purpose | Token | If disallowed |
|---|---|---|
| Google Search, including AI Overviews & AI Mode | Googlebot | Page is not crawled for Search at all. |
| Gemini training and grounding; training of the models behind Search’s AI features | Google-Extended | No effect on Search inclusion or AI Overviews display. |
| ChatGPT search results | OAI-SearchBot | Not shown in ChatGPT search answers (may still appear as navigational links). |
| OpenAI model training | GPTBot | Content indicated as not for training. |
| User-initiated fetches in ChatGPT | ChatGPT-User | robots.txt “may not apply”; not used for search inclusion. |
| Claude search results | Claude-SearchBot | Content not indexed for Claude’s search; “may reduce your site’s visibility”. |
| Claude user requests | Claude-User | Claude cannot fetch your pages when users ask about them. |
| Anthropic model training | ClaudeBot | Future content excluded from training datasets. |
| Perplexity search results | PerplexityBot | Not surfaced in Perplexity search results. |
| User-initiated fetches in Perplexity | Perplexity-User | “Generally ignores robots.txt rules”, since a user asked. |
2. Write the rules
Section titled “2. Write the rules”Example: appear in Google, ChatGPT, Claude and Perplexity search; opt out of model training.
user-agent: Googlebotallow: /
user-agent: OAI-SearchBotallow: /
user-agent: GPTBotdisallow: /
user-agent: Google-Extendeddisallow: /
user-agent: Claude-SearchBotallow: /
user-agent: ClaudeBotdisallow: /
user-agent: PerplexityBotallow: /
user-agent: *allow: /A crawler follows only the most specific group matching its name, so rules under * do not add to a named group.
3. Verify
Section titled “3. Verify”- Fetch the live file:
curl -sA "OAI-SearchBot" https://example.com/robots.txt. - In Google Search Console, open the robots.txt report to confirm Google fetched the new version.
- Check server or CDN logs for requests from each bot, and confirm the source IPs against the vendor’s published ranges (OpenAI publishes them as JSON for each bot).
Rollback
Section titled “Rollback”Restore the previous file. Google usually refreshes its cached copy within 24 hours.
Common mistakes
Section titled “Common mistakes”- Blocking
OAI-SearchBotwhile meaning to block training. - Assuming Google-Extended removes content from AI Overviews. It does not; use the Search generative AI control or snippet controls.
- Allowing bots in robots.txt while a WAF rule still returns
403.