Blocking AI Crawlers with robots.txt: GPTBot, ClaudeBot and More
More and more site owners don’t want their writing or images used to train AI. By adding AI crawler names to robots.txt, you can ask each company’s crawler to stop fetching your pages. But AI crawlers come in three kinds, for training, for AI search and for fetching pages on a user’s request, and which ones you block makes a big difference. This article lists the main AI crawlers and what they do, shows how to write robots.txt for each goal, and explains what to watch out for.
Think of AI crawlers in three groups
Most AI companies use a different crawler name for each purpose. Because robots.txt lets you decide name by name whether to block, it helps to understand the roles first.
- Training: crawlers that collect public pages to build AI models. Blocking them makes it less likely your pages end up in future training data.
- AI search: crawlers that collect pages so an AI can introduce or cite sites in its answers, such as ChatGPT search or Perplexity. Blocking them makes it less likely you’ll be mentioned in those answers.
- User-requested fetches: an agent that opens a page on the spot when someone asks the AI to “read this page”. Some companies treat these as outside the scope of robots.txt.
The main AI crawlers and their roles
| User-agent | Company | Role |
|---|---|---|
| GPTBot | OpenAI | Training |
| OAI-SearchBot | OpenAI | ChatGPT search |
| ChatGPT-User | OpenAI | User-requested fetches |
| ClaudeBot | Anthropic | Training |
| Claude-SearchBot | Anthropic | Claude search |
| Claude-User | Anthropic | User-requested fetches |
| Google-Extended | Use for training and answers in Gemini and other AI (does not affect Google Search) | |
| Applebot-Extended | Apple | Training for Apple Intelligence and more (does not affect Apple’s search) |
| meta-externalagent | Meta | Training |
| CCBot | Common Crawl | Public dataset (used to train many AI models) |
| Bytespider | ByteDance | Training and other uses |
| Amazonbot | Amazon | Improving services such as Alexa |
| PerplexityBot | Perplexity | Perplexity search |
These names are published by each company, and new crawlers appear and names change from time to time. Check each company’s official documentation for the current names before you block anything.
How to write robots.txt for each goal
- 1
Block AI training only, stay in search and AI search
Write six lines, User-agent: GPTBot / User-agent: ClaudeBot / User-agent: Google-Extended / User-agent: Applebot-Extended / User-agent: meta-externalagent / User-agent: CCBot, followed by a single “Disallow: /”. Leave the User-agent: * group as it is. This is the approach with the least side effects.
- 2
Also block citations in AI search
Add OAI-SearchBot, Claude-SearchBot and PerplexityBot to the names above. Your site will be mentioned less often in ChatGPT or Perplexity answers, so think carefully if you expect traffic from AI.
- 3
Keep only certain folders out of training
Instead of “Disallow: /”, list only the folders you want to protect, such as “Disallow: /members/” and “Disallow: /illust/”. That way you can, for example, allow blog posts but keep illustrations and paid articles out.
In the tester’s “Create AI crawler blocks”, you can generate these lines in one go by choosing “Block training only”, “Block training and AI search” or “Block all”. Add the lines to your robots.txt, then use the check to confirm the result is what you intended, such as Googlebot allowed and GPTBot blocked, before you publish. How to group several names together is explained in how to write User-agent lines.
Effects on Google Search and AI Overviews
- Blocking Google-Extended does not affect your rankings or appearance in Google Search.
- AI Overviews in Google Search are treated as part of Google Search, so Google-Extended can’t switch them off. If you don’t want to appear there, use page-level controls such as nosnippet.
- Blocking Googlebot will gradually remove you from Google Search itself, so don’t block Googlebot as an anti-AI measure.
- Blocking Applebot-Extended does not affect Applebot, which is used for Siri and Spotlight search.
What robots.txt can and can’t do
robots.txt is a request saying “please don’t fetch these pages”, and it can’t be enforced. It works on major crawlers that publish their names and state that they follow robots.txt, but it can’t stop crawlers that fake their name or ignore robots.txt.
- Data that has already been used for training is not withdrawn when you add lines to robots.txt. It only affects future fetching.
- Your robots.txt can’t stop copies of your text republished on other sites, or anything already included in datasets such as Common Crawl in the past.
- If you need a hard block, you can also refuse requests from specific User-agents or IP addresses in your server or CDN settings.
- Removing a page from search results is not the same as stopping crawling. The difference is explained in robots.txt vs noindex.
FAQ
- How do I stop ChatGPT from training on my site?
- Add “User-agent: GPTBot” and “Disallow: /” to robots.txt. OpenAI’s training crawler will stop fetching your pages. OAI-SearchBot, which is used for ChatGPT search, has a different name, so leave it alone if you still want to appear in search.
- Will blocking Google-Extended lower my Google rankings?
- No. Google-Extended only decides whether your content may be used for Gemini and other AI. It is not used for Google Search crawling or ranking.
- If I block AI crawlers, will I disappear from AI search?
- If you block only the training crawlers such as GPTBot and ClaudeBot, the AI search crawlers OAI-SearchBot and Claude-SearchBot can still fetch your pages. If you also block the AI search names, you’ll be mentioned less often in those answers.
- Does robots.txt guarantee my site won’t be used for AI training?
- No. robots.txt is a request that crawlers choose whether to honour. The major companies say their crawlers follow it, but it can’t stop data that has already been collected or copies on other sites.
Tools in this article
Related articles
How to Check robots.txt: Testing for Blocks Now That the Search Console Tester Is Gone
The robots.txt Tester in Google Search Console was retired in December 2023 and replaced by the “robots.txt report”. Because the report doesn’t let you enter a URL and test whether it’s blocked, many people are left wondering where to check. This article covers where robots.txt lives and how to open it, what the Search Console report and URL Inspection tool can and can’t tell you, how to check each URL with a tester, and how changes take effect after you edit the file.
Read article →How to Write User-agent in robots.txt: What Happens When You List Both * and Googlebot
If your robots.txt has both a “User-agent: *” group and a “User-agent: Googlebot” group, Googlebot stops using the rules under “*”. A common problem is adding a Googlebot group without knowing this, only to find that pages you thought were blocked are now being crawled. This article explains how a crawler decides which group to follow, the special cases such as Googlebot-Image and AdsBot-Google, and how to combine groups and avoid common mistakes.
Read article →robots.txt vs noindex: The Right Way to Remove a Page from Search Results
“I blocked it in robots.txt, but it still shows up in search.” “Search Console says ‘Indexed, though blocked by robots.txt’.” Most of these problems come from mixing up what robots.txt and noindex do. This article explains the difference between crawling and indexing, the correct steps to remove a page from search results, why Noindex and Crawl-delay in robots.txt don’t work, and how to deal with common Search Console messages and syntax mistakes.
Read article →