How to set up robots.txt for AI crawlers
Set up robots.txt for AI crawlers by deciding three things separately: whether AI search engines may crawl you (OAI-SearchBot, PerplexityBot, Claude-SearchBot), whether your content may be used for model training (GPTBot, ClaudeBot, Google-Extended), and how to handle user-triggered fetchers. Most businesses should allow the search crawlers, choose a training policy, and test that their firewall agrees.
The short answer
To set up robots.txt for AI crawlers, allow the bots that put you in AI search answers, make a deliberate choice about the bots that collect training data, and leave Googlebot and Bingbot alone. AI companies now run several crawlers each, with different jobs, and a single "block AI" rule usually blocks more than people intend.
robots.txt is a plain text file at the root of your domain, such as example.com/robots.txt, that tells crawlers which paths they may request. It is a request that reputable crawlers honour. It doesn't hide pages or stop bad actors.
Know the three kinds of AI crawler
Each major AI company now documents its user agents. The table below summarizes what OpenAI, Anthropic, Perplexity and Google say about theirs.
| User agent or token | Company | Job | Effect of blocking |
|---|---|---|---|
| OAI-SearchBot | OpenAI | Search results in ChatGPT | Site isn't shown in ChatGPT search answers |
| GPTBot | OpenAI | Training data | Signals content shouldn't be used for training |
| ChatGPT-User | OpenAI | User-requested visits | OpenAI says robots.txt rules may not apply |
| Claude-SearchBot | Anthropic | Search quality | May reduce visibility in Claude search results |
| ClaudeBot | Anthropic | Training data | Future content excluded from training |
| Claude-User | Anthropic | User-requested visits | Claude can't fetch your pages for users |
| PerplexityBot | Perplexity | Search results | Site not surfaced in Perplexity results |
| Perplexity-User | Perplexity | User-requested visits | Generally ignores robots.txt |
| Google-Extended | Gemini training and grounding | No effect on Google Search inclusion or ranking |
Google-Extended is a control token with no crawler of its own. Google says it governs whether content may be used to train future Gemini models and for grounding, where Search index content is given to the model at prompt time. Blocking it doesn't remove you from Google Search or AI Overviews, but it can limit how Gemini apps use your pages.
User-triggered fetchers sit in a grey area. When someone pastes your URL into ChatGPT or asks Perplexity about your page, the visit happens because a person asked for it, so OpenAI and Perplexity say robots.txt may not apply. If you truly need a page kept away from these tools, put it behind a login. robots.txt alone won't keep it private.
How robots.txt rules are read
The rules are defined in the Robots Exclusion Protocol, RFC 9309, published by the IETF in 2022. A few details trip people up.
Groups and matching
A file is made of groups. Each group starts with one or more User-agent lines and lists Allow and Disallow rules. Within a group, the longest matching path wins, and if an Allow and a Disallow rule are equally specific, Allow takes precedence.
Why a named group overrides the wildcard
A crawler looks for a group that names its own token. If it finds one, it follows that group and ignores the "User-agent: *" group entirely. So if your wildcard group blocks /admin/ and you add a separate group allowing GPTBot, GPTBot can crawl /admin/ unless you repeat the rule. Copy shared rules into every named group.
One file per host
Rules apply per protocol and host, so shop.example.com needs its own file. Anthropic makes the same point for subdomains. The file must be UTF-8 plain text, and RFC 9309 says a 5xx server error on robots.txt should be treated as a full disallow, which can quietly stop crawling during an outage.
A template most businesses can use
This setup allows search and user-triggered crawlers, opts out of model training, and keeps a shared private folder closed for everyone. Adjust the training lines to match your own policy.
| Group | Lines | Why |
|---|---|---|
| Everyone | User-agent: * / Disallow: /admin/ | Default rules for all other crawlers |
| AI search crawlers | User-agent: OAI-SearchBot, PerplexityBot, Claude-SearchBot (one line each) / Disallow: /admin/ | Stay visible in AI answers; repeat shared rules |
| Training crawlers | User-agent: GPTBot, ClaudeBot (one line each) / Disallow: / | Opt out of future training data |
| Gemini training | User-agent: Google-Extended / Disallow: / | Optional; also limits Gemini grounding |
| Sitemap | Sitemap: https://example.com/sitemap.xml | Helps every crawler find your URLs |
Several user agents can share one group by listing a User-agent line for each before the rules. Don't add groups for Googlebot or Bingbot unless you have a specific reason, since many AI products depend on those indexes.
Common mistakes to avoid
- Copying a "block all AI bots" list from a forum that includes OAI-SearchBot or PerplexityBot.
- Adding a named group for a crawler and forgetting to repeat the shared Disallow rules.
- Blocking CSS and JavaScript folders, which stops crawlers from rendering your pages properly.
- Leaving a staging-site "Disallow: /" in place after launch.
- Writing "User-agent: GPTbot" with odd spacing or typos. Matching ignores case, but a misspelled token matches nothing.
Test and maintain the file
- Open yourdomain.com/robots.txt in a browser and confirm it returns the file, not an error page.
- Check server or CDN logs for each AI user agent and confirm they receive 200 responses on normal pages.
- Review firewall and bot-protection rules. Perplexity and OpenAI both publish IP ranges you can allow.
- Allow time to propagate. OpenAI says about 24 hours; Perplexity says up to 24 hours.
- Recheck the file every quarter, because companies add and rename crawlers.
robots.txt is one part of AI visibility. Pair it with a sensible llms.txt file for AI agents, and read our explainer on what llms.txt is to see how the two differ. For the wider picture, start with what generative engine optimization is.
How Tcom can help
We audit robots.txt, firewall rules and server logs together, because a mismatch between them is a frequent reason AI search engines can't reach a site. See our AI search visibility service, try our free tools, or contact us to have your setup checked.
Questions
Will blocking GPTBot hurt my Google rankings?
No. GPTBot is OpenAI's training crawler and has nothing to do with Google. Google's own training control, Google-Extended, also has no effect on Search ranking.
Can I block AI training but stay in AI search?
Yes. Allow OAI-SearchBot, PerplexityBot and Claude-SearchBot, and disallow GPTBot and ClaudeBot. The companies document these as separate controls.
Does robots.txt stop people from copying my content?
No. It is a set of instructions that reputable crawlers follow. It doesn't protect content from scrapers that ignore it, and user-triggered fetchers may not apply it.
Is Crawl-delay supported?
Crawl-delay isn't part of RFC 9309. Anthropic says it supports it as a non-standard extension, but you shouldn't rely on every crawler honouring it.
Sources
- Overview of OpenAI crawlers OpenAI
- Does Anthropic crawl data from the web, and how can site owners block the crawler? Anthropic (Claude Help Center)
- Perplexity crawlers Perplexity
- Google's common crawlers Google Search Central
- RFC 9309: Robots Exclusion Protocol IETF
Sources checked 23 November 2026.