Blocking AI crawlers is a legitimate choice, and it is a choice many businesses make for good reasons. You may not want your content used to train future models. You may not want your prices scraped and compared. You may simply want to reduce server load from automated traffic. Whatever the reason, the way to do it matters, because a block written the wrong way can block the wrong crawler, block nothing at all, or block your own customers from finding you in search.
This guide shows you how to block AI crawlers properly in robots.txt, using only tokens the vendors themselves publish, and it shows you the limits of that block, so you do not walk away believing you have a lock when you only have a request.
The short answer
To block an AI crawler, give it its own group in robots.txt with Disallow: / . One group per crawler, one token per group, and no shortcuts. A block for a training crawler does not block search, and a block for a search crawler does not block training, because the vendors run separate crawlers for separate jobs and say each setting is independent.
The standard behind the file is RFC 9309, the Robots Exclusion Protocol. It says the rules are not a form of access authorisation, which means a well behaved crawler follows them, but the file itself does not enforce anything. It also says a crawler must use case insensitive matching to find the group that matches its product token, and if no matching group exists, it must obey the group with a star value, if present. The most specific matching rule wins, and if no rule matches, the page is allowed.
That last point is the one that matters most for blocking. A crawler with its own group ignores the star group entirely. If you write a star group that blocks everything, and then add a named group for one crawler that allows everything, that crawler is allowed, because its own group wins. If you write a named group that blocks one crawler, that crawler is blocked, even if the star group allows everything. Every named group must be complete on its own.
How it works, step by step
Step one is to decide what you are actually blocking. There are three different things people mean when they say block AI crawlers, and they need three different rules. Blocking training means stopping a vendor from using your content to train future models. Blocking search means stopping your pages from appearing in AI answers. Blocking live fetching means stopping a system from visiting a page while it answers a specific person question. Those are different crawlers, different tokens, and different results, and mixing them up is the most common mistake in this whole area.
Step two is to list the training crawlers, because training is the reason most businesses block anything. The tokens below are published by the vendors in their own documentation:
- GPTBot, from OpenAI, crawls content that may be used in training generative AI foundation models. OpenAI says disallowing GPTBot indicates a site content should not be used in training those models.
- ClaudeBot, from Anthropic, collects web content that could potentially contribute to training. Anthropic says restricting ClaudeBot signals that the site future materials should be excluded from its AI model training datasets.
- meta-externalagent, from Meta, crawls for uses such as training foundation AI models or improving products by indexing content directly.
- Google-Extended, from Google, is not a crawler. It is a standalone product token that tells Google whether content already crawled may be used to train future Gemini models and for grounding. Google says it does not affect inclusion in Google Search and is not a ranking signal.
Step three is to list the search crawlers, and to decide separately whether you want to block them. Blocking search is a bigger decision than blocking training, because it removes your pages from AI answers entirely. The tokens are OAI-SearchBot for ChatGPT search, Claude-SearchBot for Claude search, PerplexityBot for Perplexity results, meta-webindexer for Meta AI search, and Googlebot for Google Search including AI Overviews. OpenAI says sites opted out of OAI-SearchBot will not be shown in ChatGPT search answers. Anthropic says disabling Claude-SearchBot prevents indexing for search, which may reduce visibility and accuracy in search results. Perplexity recommends allowing PerplexityBot if you want to appear in its results.
Step four is to list the live fetchers, and to understand that robots.txt often does not reach them. ChatGPT-User fetches a page when a user asks ChatGPT a question, and OpenAI says robots.txt rules may not apply because the actions are initiated by a user. Perplexity-User supports user actions within Perplexity, and Perplexity says this fetcher generally ignores robots.txt rules because a user requested the fetch. Meta-externalfetcher fetches a single link at a user request, and Meta says it may bypass robots.txt. A Disallow line for those tokens is a statement of preference, not a reliable block. If you need to stop live fetches, you need a firewall or bot management rule as well, and you should check the vendor docs for the current guidance.
Step five is to write the file. One group per token, Disallow: / for each token you want to block, placed near the top of the file, before any broad allow rules. The code block later in this guide shows a complete example that blocks training crawlers while keeping search open, and a second example that blocks everything. Choose the one that matches your decision, and do not copy both.
What to do on your site
Start by writing down the decision, before you touch the file. Who decided to block, what exactly is being blocked, training or search or both, and why. A block that no one remembers is a block that gets undone by the next redesign, or a block that stays in place long after the reason for it has gone. A one line note in your site documentation saves that confusion.
Then open the current robots.txt file and read it fully. Look for a star group, look for named groups, and look for tokens you do not recognise. Tokens with no vendor documentation behind them, such as GrokBot and DeepSeekBot, circulate in third party bot lists, but neither vendor has published a crawler user agent or robots.txt guidance in the docs checked for this guide. Rules written for those tokens are best effort only. They might catch stray traffic, but they cannot be relied on, and this guide does not include them as verified tokens.
Then write the block you decided on. If you are blocking training only, use the first code block below. If you are blocking search as well, use the second. Do not mix the two by accident. A training only block that also names OAI-SearchBot is not a training only block, it is a search block too, and it will remove your pages from ChatGPT search answers.
A worked example
Imagine a local bookshop called Cornerstone Books that sells new and second hand books, runs author events, and publishes staff reviews on its blog. The owner is happy for AI systems to recommend the shop and cite its event pages, but does not want the staff reviews used to train future models. The owner decides to block training crawlers only, and to keep search crawlers open.
The owner writes the first code block below into the robots.txt file: Disallow: / for GPTBot, ClaudeBot, meta-externalagent, and Google-Extended, and Allow: / for OAI-SearchBot, Claude-SearchBot, PerplexityBot, meta-webindexer, and Googlebot. The owner records the decision in a short note, with the reason and the date the decision was made in the shop own records, not in the article.
A week later the owner checks the server logs. Visits from GPTBot and ClaudeBot have stopped. Visits from OAI-SearchBot and PerplexityBot continue, and the shop event pages still appear in AI answers. The staff reviews are no longer being gathered for future training, as far as the vendor statements go, while the shop remains findable. That is the outcome a training only block is meant to produce.
Now imagine the owner had instead copied a block all AI crawlers file from a blog post, with a star group that blocked everything and a long list of unverified tokens. The event pages would have vanished from AI answers, the shop would have lost the recommendations it wanted, and the owner would have blamed the AI systems for ignoring the shop, when the real cause was a file that blocked too much. The difference between the two outcomes is not effort. It is precision, and precision starts with naming only the tokens you mean to block.
The machine readable part
Use the first block if you want to block training only and keep search open. Use the second block only if you have decided to block search as well. Do not use both at once.
Training only, search stays open:
User-agent: GPTBot
Disallow: /
User-agent: ClaudeBot
Disallow: /
User-agent: meta-externalagent
Disallow: /
User-agent: Google-Extended
Disallow: /
User-agent: OAI-SearchBot
Allow: /
User-agent: Claude-SearchBot
Allow: /
User-agent: PerplexityBot
Allow: /
User-agent: meta-webindexer
Allow: /
User-agent: Googlebot
Allow: /
Block search and training:
User-agent: GPTBot
Disallow: /
User-agent: OAI-SearchBot
Disallow: /
User-agent: ClaudeBot
Disallow: /
User-agent: Claude-SearchBot
Disallow: /
User-agent: PerplexityBot
Disallow: /
User-agent: meta-webindexer
Disallow: /
User-agent: meta-externalagent
Disallow: /
User-agent: Google-Extended
Disallow: /
User-agent: Googlebot
Disallow: /
The second block also blocks Googlebot, which removes the site from Google Search entirely, including AI Overviews and AI Mode, because those features draw on indexed pages. That is a large decision, and it should not be made by copying a file. If you want to stop AI training but stay in Google Search, use the first block, not the second.
Mistakes to avoid
Mistake one is blocking the wrong crawler. GPTBot is training, OAI-SearchBot is search. ClaudeBot is training, Claude-SearchBot is search. A block for the training token does not remove you from answers, and a block for the search token does not stop training. Name the token you mean.
Mistake two is using a star group as a shortcut and then adding named groups that undo it. A named group wins over the star group, so a star block plus a named allow is an allow, not a block. Write each named group as a complete decision.
Mistake three is trusting robots.txt to stop live fetchers. ChatGPT-User, Perplexity-User, and meta-externalfetcher generally ignore robots.txt or may bypass it, because a person asked for the page. A robots.txt block will not reliably stop them. Use a firewall or bot management rule if you need enforcement.
Mistake four is using unverified tokens as if they were official. Tokens with no vendor documentation cannot be relied on, and a file full of them gives a false sense of coverage. Use only the tokens the vendors publish, and check the vendor docs when a new token appears in a blog post.
Frequently Asked Questions
Will blocking AI crawlers remove my site from Google Search?
Only if you block Googlebot. Blocking GPTBot, ClaudeBot, or Google-Extended does not remove you from Google Search. Google-Extended governs Gemini training and grounding only, and Google says it does not affect Search inclusion. Blocking Googlebot removes the site from Search entirely, including AI Overviews.
Does a robots.txt block delete content already used for training?
No. The vendor opt outs are forward looking. Anthropic says a ClaudeBot restriction signals that future materials should be excluded from training datasets. OpenAI describes GPTBot disallow in the same forward looking way. There is no robots.txt procedure for withdrawing content already collected.
Can I block training but stay in AI answers?
Yes. That is the training only file in this guide. Allow OAI-SearchBot, Claude-SearchBot, PerplexityBot, meta-webindexer, and Googlebot, and disallow GPTBot, ClaudeBot, meta-externalagent, and Google-Extended. Search and training are separate settings, and the vendors say so in their own docs.
Verified Sources & Technical Documentation
- RFC 9309, Robots Exclusion Protocol Specific https://www.rfc-editor.org/rfc/rfc9309.html
- OpenAI bots documentation Specific https://platform.openai.com/docs/bots
- Anthropic: does Anthropic crawl data from the web, and how can site owners block the crawler Specific https://privacy.claude.com/en/articles/8896518-does-anthropic-crawl-data-from-the-web-and-how-can-site-owners-block-the-crawler
- Perplexity crawlers documentation Specific https://docs.perplexity.ai/guides/bots
- Meta web crawlers documentation Specific https://developers.facebook.com/documentation/sharing/webmasters/web-crawlers
- Google Search Central: how Google interprets the robots.txt specification General Docs https://developers.google.com/search/docs/crawling-indexing/robots/robots_txt
links marked specific point to the page that supports the claim in this guide. Links marked general docs point to the vendor's general docs section for that topic, not to a page that proves every step. Check the vendor docs for the current path before relying on a menu name or click path in this guide.