Robots.txt for AI crawlers works like robots.txt for any crawler: you add a group per user agent, then Allow or Disallow paths. The difference is that AI vendors run separate bots for training and search, so one rule rarely covers both. Below are three templates you can paste and adapt.
The bot names and behavior here come from vendor documentation as of November 2026. Check the pages linked below before publishing, because vendors rename and add bots.
How does robots.txt for AI crawlers work?

Robots.txt is a voluntary standard, formalized in RFC 9309. A compliant crawler fetches /robots.txt from the host, finds the group that best matches its own user agent name, and follows those rules. If no group matches, it falls back to User-agent: *.
Three consequences follow for AI bots:
- A named group overrides the wildcard for that bot. You can block everything with
*and still allow one bot by naming it. - Rules are per host. Each subdomain needs its own robots.txt.
- It is a request, not access control. Robots.txt does not stop a bot that ignores it, and some user-triggered fetchers are documented as not following it.
Template 1: block AI training, stay visible in AI search

This is the common choice for sites that want citations but not training use. It disallows the training crawlers and explicitly allows the search crawlers.
# Training crawlers: opt out
User-agent: GPTBot
Disallow: /
User-agent: ClaudeBot
Disallow: /
User-agent: Google-Extended
Disallow: /
User-agent: Applebot-Extended
Disallow: /
User-agent: meta-externalagent
Disallow: /
User-agent: CCBot
Disallow: /
# AI search crawlers: stay eligible
User-agent: OAI-SearchBot
Allow: /
User-agent: Claude-SearchBot
Allow: /
User-agent: PerplexityBot
Allow: /
# Everyone else
User-agent: *
Allow: /
What each line does, according to the vendors:
- GPTBot: OpenAI says disallowing it indicates content should not be used to train its foundation models.
- ClaudeBot: Anthropic says restricting it signals that future material should be excluded from training datasets.
- Google-Extended: a token that controls use for future Gemini model training and for grounding in Gemini Apps and Vertex AI. Google says it does not affect inclusion in Google Search. See Google's crawler documentation.
- Applebot-Extended: opts out of training use of data Applebot crawled. It does not crawl by itself.
- OAI-SearchBot, Claude-SearchBot, PerplexityBot: the search index bots. Allowing them keeps you eligible for those engines' answers.
Be aware that OpenAI notes it may use one crawl for both purposes when both GPTBot and OAI-SearchBot are allowed. Setting both rules explicitly, as above, keeps your intent clear. For a closer look at the OpenAI bots, read OAI-SearchBot vs GPTBot vs ChatGPT-User.
Template 2: allow all AI crawlers

If you want maximum reach and are fine with training use, an open file is enough. Naming the bots is optional but documents intent for your team.
User-agent: *
Allow: /
User-agent: GPTBot
Allow: /
User-agent: OAI-SearchBot
Allow: /
User-agent: ClaudeBot
Allow: /
User-agent: Claude-SearchBot
Allow: /
User-agent: PerplexityBot
Allow: /
Sitemap: https://www.example.com/sitemap.xml
Replace the sitemap URL with your own. An empty or missing robots.txt (404) also means crawlers may fetch everything, but a clear file is easier to audit. Make sure the file returns a 200 status rather than a server error, since an unreachable robots.txt can change how crawlers behave.
Template 3: block all AI crawlers in robots.txt
Use this if you want out of both training and AI search. It blocks the named bots and leaves normal search crawlers alone.
User-agent: GPTBot
Disallow: /
User-agent: OAI-SearchBot
Disallow: /
User-agent: ClaudeBot
Disallow: /
User-agent: Claude-SearchBot
Disallow: /
User-agent: Claude-User
Disallow: /
User-agent: PerplexityBot
Disallow: /
User-agent: Google-Extended
Disallow: /
User-agent: Applebot-Extended
Disallow: /
User-agent: meta-externalagent
Disallow: /
User-agent: CCBot
Disallow: /
This will not stop every AI fetch. OpenAI says robots.txt rules may not apply to ChatGPT-User, Perplexity says Perplexity-User generally ignores robots.txt, and Meta says meta-externalfetcher may bypass it. Those are user-triggered fetchers. If you need a hard block, use authentication or server-level rules, and expect that real readers using those tools will be blocked too.
Blocking OAI-SearchBot also means your site will not appear in ChatGPT search answers, per OpenAI, though it can still show as a navigational link. That is the trade-off you are choosing.
How do you block only part of a site?
Use path rules inside a bot's group. This keeps public articles open and hides a members area from training crawlers:
User-agent: GPTBot
Disallow: /members/
Disallow: /drafts/
Allow: /
Keep paths specific and test them. A broad Disallow: / in the wrong group is the most common robots.txt mistake, and it is easy to miss because the site keeps working for humans.
Keep one file under version control and review changes the way you review code. A robots.txt edit can remove your whole site from an AI engine's index, so it deserves a second pair of eyes and a quick check after each deploy.
How do you test your robots.txt for AI crawlers?
- Load
https://yourdomain.com/robots.txtand confirm a 200 status and plain text content type. - Check that no
User-agent: *block above your named groups blocks bots you meant to allow. Order does not decide matching, but a missing named group does. - Look in your server logs for each bot and confirm it receives 200 responses on pages, not 403 from a firewall. See the AI crawler user agents list for names and verification notes.
- Wait for propagation. OpenAI says about 24 hours for search systems, and Perplexity says up to 24 hours.
Do not add Crawl-delay for bots that ignore it. Anthropic documents support for it, while Apple documents that Applebot ignores it.
Common robots.txt mistakes with AI bots
- Typos in the bot name. A group for
GPT-BotorOpenAI-SearchBotmatches nothing. Copy names exactly from the vendor pages. - Blocking the file itself. A WAF or CDN rule that returns 403 to unknown bots can stop crawlers from reading robots.txt. Anthropic warns that IP blocking can prevent its bots from reading the file.
- Putting rules in the wrong host. A file on
example.comdoes not apply toblog.example.com. - Mixing up tokens and crawlers. Google-Extended and Applebot-Extended are controls, not bots that visit your pages. They will never show up in your logs.
- Using wildcard blocks by accident. A staging file with
User-agent: *andDisallow: /that reaches production blocks every bot you did not name.
After any change, re-read the file as a crawler would, from a clean request with no cookies, and confirm the live version matches what you deployed.
What robots.txt does not do
An allow rule makes a page reachable, nothing more. If the content is injected by client-side JavaScript, the bot may see an empty shell, which is covered in JavaScript rendering for AI crawlers. Robots.txt is also not the same as llms.txt; see does llms.txt work for how those differ. Neither guarantees a citation. A clean robots.txt removes one technical reason a bot could not use your pages.
Sources for the vendor behavior above: OpenAI bots, Anthropic crawler help and Perplexity bots.
Audit your AI crawler rules
To see how your current file reads to AI crawlers, run a free AEO Vista audit. The AI policy category checks which AI bots your robots.txt allows or blocks, and the crawlability category flags pages those bots cannot fetch.



