Skip to content
Search

How to allow or block AI bots in robots.txt

robots.txt rules to allow all crawlers, block AI training or block all AI bots, from RFC 9309 and the tokens that AI bot operators document.

In short. Write a robots.txt group for each bot: a User-agent line with the token its operator documents, then Allow and Disallow rules. A bot follows only the group that names it, and within that group the longest matching path wins. OpenAI, Google, Perplexity, Meta and Amazon say some of their user-initiated fetchers may not follow robots.txt. Google-Extended and Applebot-Extended are control tokens that send no requests.

On this page 11 sections

The evidence

Confirmed

Crawlers match the User-agent line case-insensitively. If several groups match a crawler, it combines them. If none match, it obeys the group for *, and with no such group no rules apply.1

1IETFRFC 9309, section 2.2.1, Sep 2022.
Confirmed

Within a group, the most specific rule wins, measured in octets. When an Allow rule and a Disallow rule are equivalent, the crawler should use the Allow rule.1

1IETFRFC 9309, section 2.2.2.
Confirmed

OpenAI says robots.txt rules may not apply to ChatGPT-User, because a user starts these requests.6

6OpenAI
Confirmed

Perplexity says Perplexity-User generally ignores robots.txt rules, because a user requested the fetch.9

9Perplexity
Confirmed

Google-Extended has no user agent of its own. Google crawls with its existing user agents and reads the token as a control.7

7Google for Developers

robots.txt decides which AI bots may train on your content and which may show it in AI search answers, and each bot follows only the rules that name it. Among websites cited by AI answers in October and November 2026, 4.92% fully blocked GPTBot, against 0.87% for OAI-SearchBot. robots.txt is a plain-text file at the root of a host that tells crawlers which paths they may fetch. The rules are defined in RFC 9309, the Robots Exclusion Protocol, which the IETF published in September 2022.1 Each AI bot operator documents the token its bot looks for and what a rule changes.

To allow all crawlers to fetch every page, publish this file at /robots.txt, which has the same effect as an empty file:1

User-agent: *
Allow: /

#How robots.txt rules work

Each host needs its own file, and a bot that finds its own group ignores the * group. The file must be at /robots.txt in the top-level path of the host, encoded in UTF-8 and served as text/plain.1 A file on www.example.com does not cover blog.example.com. Anthropic and Amazon both say to put rules in the file of each subdomain.2 3

A group is one or more User-agent lines followed by one or more rules. The group ends at the next User-agent line or at the end of the file.1 Several User-agent lines in a row share the rules below them.

RFC 9309 sets three matching rules for groups:1

  1. A crawler matches its token against User-agent lines without regard to case.
  2. If more than one group matches, the crawler combines their rules into one group.
  3. If no group matches, the crawler obeys the User-agent: * group. If there is no such group, no rules apply.

A crawler that finds its own group ignores the * group completely. Bing's robots.txt guidance says the same for Bingbot and tells site owners to repeat general rules in the Bingbot group.4

#Allow, Disallow and longest match

The longest matching path wins, so a specific Allow rule can open one folder inside a blocked site. Within a group, the crawler compares each Allow and Disallow path with the start of the URL path. The most specific match wins, measured as the match with the most octets. When an Allow rule and a Disallow rule are equivalent, the crawler should use Allow. A URL that matches no rule is allowed, and /robots.txt itself is always allowed.1 Path matching should be case sensitive.

* matches any run of characters and $ marks the end of the path. In the RFC's example below, /example/page/disallowed.gif is blocked because the Disallow rule is longer:1

User-Agent: foobot
Allow: /example/page/
Disallow: /example/page/disallowed.gif

#Errors and caching

A server error on robots.txt closes the whole site to compliant crawlers. If the server answers the robots.txt request with a 4xx status, the crawler may access any resource. If it answers with a 5xx status or the network fails, the crawler must assume that the whole site is disallowed. Crawlers should not use a cached copy for more than 24 hours unless the file is unreachable.1

Crawl-delay is not part of RFC 9309, and support for it varies by operator. Anthropic calls it a non-standard extension and supports it.2 Common Crawl says CCBot obeys it,5 and Bing shows it in a Bingbot group.4 Amazon says its crawlers do not support it.3

#AI bot tokens

Operators run separate bots for separate jobs, so a policy has to name each token it means to cover.

Table 1.AI bot tokens. The last column gives what each operator says about its own bot.
TokenOperatorJobFollows robots.txt
GPTBotOpenAITrainingYes
OAI-SearchBotOpenAIChatGPT searchYes
ChatGPT-UserOpenAIFetches for a userRules "may not apply"
OAI-AdsBotOpenAIReviews ChatGPT ad landing pagesYes
ClaudeBotAnthropicTrainingYes
Claude-SearchBotAnthropicClaude searchYes
Claude-UserAnthropicFetches for a userYes
Google-ExtendedGoogleControl token: Gemini training and groundingSends no requests
Google-AgentGoogleAgents acting for a user"Generally ignore" rules
BingbotMicrosoftBing search, AI usesYes
PerplexityBotPerplexityPerplexity searchYes
Perplexity-UserPerplexityFetches for a user"Generally ignores" rules
meta-externalagentMetaTraining and indexingYes
meta-webindexerMetaMeta AI searchYes
meta-externalfetcherMetaFetches for a user"May bypass" rules
meta-externaladsMetaAdvertising and business productsYes
Applebot-ExtendedAppleControl token: Apple model trainingSends no requests
AmazonbotAmazonProducts, may train modelsYes
Amzn-SearchBotAmazonSearch in products such as AlexaYes
Amzn-UserAmazonFetches for a user"May not follow all" rules
CCBotCommon CrawlOpen web datasetYes
DuckAssistBotDuckDuckGoAI-assisted answersYes
BytespiderByteDanceToutiao SearchNot stated

OpenAI's crawler overview says each of its settings is independent of the others.6 Anthropic says the same of its three bots.2 A rule for one token never covers another token from the same operator.

#Rules for common choices

#Allow AI search, block training

To allow AI search and block training, put the training crawlers and control tokens in one group and the search and answer bots in another. Keep any rules your site already has for other crawlers. The robots.txt generator writes these groups for you.

# Training crawlers and control tokens
User-agent: GPTBot
User-agent: ClaudeBot
User-agent: Google-Extended
User-agent: Applebot-Extended
Disallow: /

# AI search and answer bots
User-agent: OAI-SearchBot
User-agent: Claude-SearchBot
User-agent: Claude-User
User-agent: PerplexityBot
User-agent: DuckAssistBot
User-agent: Amzn-SearchBot
User-agent: meta-webindexer
Allow: /

A GPTBot or ClaudeBot rule tells OpenAI or Anthropic not to use the content for training.6 Google's list of common crawlers says Google-Extended covers training of future Gemini models and grounding in Gemini Apps and Vertex AI.7 Apple says Applebot-Extended covers training of its foundation models, and pages that disallow it can still appear in its search results.8 Perplexity says PerplexityBot is not used to crawl content for AI foundation models.9 DuckDuckGo says DuckAssistBot data is not used to train AI models.10

Four bots do more than one job, so a block affects more than training:

  • Bingbot crawls for Bing search. Bing says a page that is not crawled will not be indexed.4
  • Meta says meta-externalagent crawls for training foundation models and for indexing content directly.11
  • Amazon says Amazonbot improves its products and services and may be used to train its AI models.3
  • CCBot builds Common Crawl's open dataset, which researchers, companies and individuals reuse.5 How to check whether your site is in Common Crawl explains that dataset.

To state a training preference to Microsoft without blocking Bingbot, add the shared training token described below.

#Block all listed AI bots

To block every listed bot, name all the tokens except Bingbot in one group. A Bingbot block removes pages from Bing's index.

User-agent: GPTBot
User-agent: OAI-SearchBot
User-agent: ChatGPT-User
User-agent: OAI-AdsBot
User-agent: ClaudeBot
User-agent: Claude-SearchBot
User-agent: Claude-User
User-agent: PerplexityBot
User-agent: Perplexity-User
User-agent: Google-Extended
User-agent: Google-Agent
User-agent: Applebot-Extended
User-agent: meta-externalagent
User-agent: meta-webindexer
User-agent: meta-externalfetcher
User-agent: Amazonbot
User-agent: Amzn-SearchBot
User-agent: Amzn-User
User-agent: CCBot
User-agent: DuckAssistBot
User-agent: Bytespider
Disallow: /

OpenAI says a site that disallows OAI-SearchBot is not shown in ChatGPT search answers, though it can still appear as a navigational link.6 Anthropic says blocking Claude-SearchBot or Claude-User may reduce a site's visibility in Claude's search results.2 DuckDuckGo says the site stops being a source for its AI-assisted answers after 72 hours, with no effect on its organic rankings.10

#Allow all

An empty file, or a missing file that returns a 4xx status, allows every crawler.1 Google's interpretation of the robots.txt specification treats every 4xx status except 429 as if no file existed.16 To state the same rule in the file, use this group:

User-agent: *
Allow: /

Google's guide to writing a robots.txt file says this group could be left out with the same result, because crawlers may fetch the whole site by default.17 An empty Disallow: line also allows everything. Google says crawlers ignore a rule that has no path.16

This group covers only bots without a group of their own. Remove any older group that names an AI token, or that bot keeps following it. Allow: / also does not override a longer Disallow rule in the same group, because the longest match wins.1

#Bots with partial robots.txt support

robots.txt may not stop three user-request fetchers, so blocking them takes a CDN or server rule. These fetchers act when a person asks an assistant about a page, and their operators say robots.txt may not bind them. OpenAI says robots.txt rules may not apply to ChatGPT-User, because a user starts these actions.6 Perplexity says Perplexity-User generally ignores robots.txt rules for the same reason.9 Meta says its Meta-ExternalFetcher, which fetches links at a user's request, may bypass robots.txt.11 How to block AI crawlers covers those CDN and server rules.

ByteDance's page about Bytespider does not say whether the crawler follows robots.txt.12

Google-Extended and Applebot-Extended are control tokens. Google crawls with its existing user agents and reads Google-Extended only as a control.7 Apple says Applebot-Extended does not crawl webpages.8 A rule for either token stops no requests. To stop the crawling itself, a site has to block Googlebot or Applebot, which also removes its pages from Google Search or Apple's search features.

#The shared training token

Microsoft plans to honor a shared training token from February 1, 2027, so add it if Bing matters to your site. The Machine-Readable Training Preference Signal draft defines a policy token for AI training. A Disallow rule states a preference against training for that path.13

User-agent: __usage_ai-training
Disallow: /

The draft says a User-agent: * group must never be read as matching this token. It also says the token is not a crawling directive, so crawler groups still control access.13 The draft is an individual Internet-Draft with no formal standing in the IETF process. Microsoft's announcement of October 30, 2026 uses this syntax and says Microsoft starts to honor it on February 1, 2027.14 Training vs search bots compares each operator's plans.

#Blocks before robots.txt

A CDN or firewall can refuse a bot's requests before the bot reads robots.txt, so check the edge before you trust the file. Cloudflare's Block setting for Training also stops Googlebot, Bingbot and Applebot, according to Cloudflare's September 15, 2026 announcement.15 How Cloudflare's AI bot settings work covers each setting.

Anthropic warns that blocking its IP addresses can stop its bots from reading robots.txt, so the opt-out may not work.2 OpenAI and Perplexity recommend that sites allow requests from their published IP ranges.6 9 Perplexity notes that Cloudflare's Bot Fight Mode can still challenge its bots after a firewall rule allows them.9

#Rules on cited websites

In our crawl of the websites that AI answers cited in October and November 2026, 8.52% of domains with a valid robots.txt fully blocked at least one AI crawler. Training crawlers were blocked more often than search crawlers: 4.92% fully blocked GPTBot, against 0.87% for OAI-SearchBot.

Of the same domains, 4.15% blocked GPTBot and let OAI-SearchBot fetch the site. Do websites cited by AI answers block AI crawlers? gives the figures for each crawler and engine.

#Check the live file

  1. Fetch the file as a crawler sees it: curl -s https://example.com/robots.txt. Repeat for each subdomain, because each host needs its own file.
  2. Check the status code with curl -sI. A 5xx answer tells every crawler that the whole site is disallowed.
  3. Search the file for each token you meant to name, and for older groups that name the same tokens. The AI crawler checker shows which rule applies to each bot.
  4. Allow time for cached copies to expire. OpenAI says its search systems need about 24 hours to adjust.6 Perplexity and Meta give up to 24 hours.9 11 Amazon says its crawlers may use a copy from the last 30 days.3
  5. If you use a CDN, compare its bot settings with the file, so you can catch an edge rule that blocks a bot the file allows.

The file is the first step of an AI crawlability audit, which also checks CDN rules, the raw HTML, sitemaps and server logs.

Questions

Does blocking GPTBot remove my site from ChatGPT search?

No. OpenAI says the GPTBot and OAI-SearchBot settings are independent. A site that disallows OAI-SearchBot is left out of ChatGPT search answers, though it can still appear as a navigational link.

Does a rule for User-agent * block AI bots?

It applies to every bot that has no group of its own in the file. A bot that finds a group with its own token ignores the * group. The shared training token __usage_ai-training is also never matched by *.

Does an empty robots.txt file allow all crawlers?

Yes. RFC 9309 says that when a file has no groups, no rules apply. Google says every file is implicitly allowed for crawling unless robots.txt says otherwise. A missing file that returns a 404 status has the same effect.

Is Allow: / the same as an empty Disallow: line?

Both allow every path when they are the only rule in the group. Allow: / matches every URL path. An empty Disallow line has no path, and Google says crawlers ignore a rule without a path. Neither one overrides a longer Disallow rule in the same group, because the most specific match wins.

How long does a robots.txt change take to apply?

RFC 9309 says crawlers should not use a cached copy for more than 24 hours. Operators state their own times: about 24 hours for OpenAI's search systems, up to 24 hours for Perplexity and Meta, 72 hours for DuckAssistBot. Amazon says its crawlers may use a copy from the last 30 days.

Can robots.txt keep a page private?

No. RFC 9309 says the protocol is not a substitute for security measures, and listing a path in robots.txt makes it public. Use authentication for private content.

Notes

  1. 1
    RFC 9309: Robots Exclusion ProtocolIETF · Sep 1, 2022 · Checked Nov 23, 2026 · Primary source
  2. 2
    Does Anthropic crawl data from the web, and how can site owners block the crawler?Anthropic Help Center · Checked Nov 23, 2026 · Primary source
  3. 3
    Amazon Web Search crawlersAmazon Developer · Primary source
  4. 4
    How to Create a robots.txt FileBing Webmaster Tools · Primary source
  5. 5
    Frequently Asked QuestionsCommon Crawl · Primary source
  6. 6
    Overview of OpenAI CrawlersOpenAI · Checked Nov 23, 2026 · Primary source
  7. 7
    List of Google's common crawlersGoogle for Developers · Checked Nov 20, 2026 · Primary source
  8. 8
    About ApplebotApple Support · Primary source
  9. 9
    Perplexity CrawlersPerplexity · Checked Nov 20, 2026 · Primary source
  10. 10
    Is DuckAssistBot related to DuckDuckGo?DuckDuckGo Help Pages · Primary source
  11. 11
    Meta Web CrawlersMeta for Developers · Primary source
  12. 12
    关于Bytespider (About Bytespider)Toutiao Search Webmaster Platform (ByteDance) · Primary source
  13. 13
    Machine-Readable Training Preference Signal (draft-kelley-aipref-training-preference-signal-01)IETF Datatracker · Nov 16, 2026 · Checked Nov 20, 2026 · Primary source
  14. 14
    Your content, your choice: clearer preferences for training and groundingMicrosoft Bing Blogs · Oct 30, 2026 · Checked Nov 20, 2026 · Primary source
  15. 15
    Have it both ways: stay discoverable in search while disallowing AI trainingCloudflare · Sep 15, 2026 · Checked Nov 23, 2026 · Primary source
  16. 16
    How Google interprets the robots.txt specificationGoogle for Developers · Oct 23, 2026 · Checked Nov 23, 2026 · Primary source
  17. 17
    How to write and submit a robots.txt fileGoogle for Developers · Nov 21, 2025 · Checked Nov 23, 2026 · Primary source

About this page

Researched and reviewed by Promptly Found. Reviewed Nov 23, 2026. Next review due Feb 2027.

Cite this page
Citation style

Promptly Found. (2026, November 23). How to allow or block AI bots in robots.txt https://promptlyfound.com/crawlers/robots-txt-for-ai

Revisions 5
Added the allow-all file near the top, Google's handling of empty rules and 4xx answers, and FAQ items on empty files and on Allow: / versus an empty Disallow line.
Added how AI-cited websites set AI crawler rules, from our crawl of cited websites.
Linked the new Meta-ExternalAds profile.
Added the tokens for OAI-AdsBot, Google-Agent, Meta-WebIndexer, Meta-ExternalFetcher, Amzn-SearchBot and Amzn-User to the token table and the example rules.
First published.