ToolsWhisper

How to Block AI Crawlers in robots.txt (GPTBot, ClaudeBot and Others)

Which user-agent names to use for OpenAI, Anthropic and Google AI crawlers, the difference between training and search bots, and a robots.txt you can paste.

Frank4 min read

If you do not want your pages used to train AI models, robots.txt is the mechanism the companies themselves point to. It is short to write, but it is easy to get wrong in two ways: blocking more than you meant to, and assuming it covers things it does not.

Everything below comes from the vendors' own documentation, linked at each point, because these names and behaviours change and secondhand lists go stale.

Training, search and user-initiated bots are different

The most useful thing to understand is that the big vendors run more than one bot, and they serve different purposes. Blocking the wrong one costs you visibility in AI search without protecting anything.

Operator User-agent What it does
OpenAI GPTBot Collects content that may be used to train OpenAI's models
OpenAI OAI-SearchBot Surfaces sites in ChatGPT's search features
OpenAI ChatGPT-User Visits a page when a user asks ChatGPT to
Anthropic ClaudeBot Collects content that may contribute to training
Anthropic Claude-SearchBot Browses the web to improve search result quality
Anthropic Claude-User Fetches a page when a Claude user asks a question that needs it
Google Google-Extended A control token for Gemini training and grounding

Sources: OpenAI's bot documentation, Anthropic's crawler help article and Google's list of common crawlers.

Two details matter in practice.

Google-Extended is not a crawler. Google describes it as a robots.txt token with no separate user-agent string: crawling still happens with Google's usual bots, and the token only controls whether what they fetched may be used for Gemini. Google states that it does not affect inclusion in Google Search or ranking, so blocking it will not cost you search traffic.

User-initiated fetchers behave differently. OpenAI notes that because ChatGPT-User acts on a person's request, robots.txt rules may not apply to it. If you want to keep your content out of ChatGPT's search results, the relevant control is OAI-SearchBot, not ChatGPT-User.

A robots.txt that blocks training only

This blocks the crawlers that collect training data and leaves search and ordinary search engines alone:

User-agent: GPTBot
User-agent: ClaudeBot
User-agent: Google-Extended
User-agent: CCBot
Disallow: /

Several User-agent lines in a row share the rules that follow, so one Disallow: / covers all four. CCBot is the crawler for Common Crawl, a public web archive that many AI training datasets are built from.

If you also want to be absent from AI search answers, add OAI-SearchBot and Claude-SearchBot to the same group. Most sites that block training deliberately leave the search bots allowed, so that they can still be cited.

Do not do this

User-agent: *
Disallow: /

That blocks every compliant crawler, Googlebot included, and your pages will drop out of search. A group for a named bot is the safe way to target it.

Also remember that a more specific group replaces the * group completely rather than adding to it. A bot with its own group follows only that group. How rules are matched is covered in the earlier robots.txt post.

Blocking only part of a site

You do not have to block everything. To keep a bot out of one section and leave the rest open, disallow just those paths:

User-agent: GPTBot
Disallow: /members/
Disallow: /drafts/

Anything not disallowed stays allowed, so no Allow: / line is needed.

What this does not do

  • It is voluntary. robots.txt only works on crawlers that choose to obey it. The vendors above say they do. Scrapers that do not identify themselves will ignore it, and stopping them takes server-side measures such as rate limiting or a firewall.
  • It does not remove anything already collected. It tells the crawler what to do from now on.
  • It is public. Anyone can read your robots.txt, so it is a request, not a lock. Anything private needs authentication.
  • Names change. Vendors add and rename bots. Check their documentation now and then, and re-test your file.

Each host needs its own file

A robots.txt applies only to the host it is served from. The file at example.com/robots.txt does not cover blog.example.com or shop.example.com. If your content lives on several subdomains, put the same rules on each one, or the crawlers will treat those hosts as unrestricted.

Checking who is actually visiting

Your access log shows which of these bots really visit and how often:

for bot in GPTBot ClaudeBot CCBot; do echo "$bot: $(grep -ci "$bot" access.log)"; done

User-agent strings can be faked, so a count is only a rough guide. If you need to be sure a request came from a particular vendor, look in its documentation for published IP ranges or another way to verify.

Informal meta tags

You may come across tags such as <meta name="robots" content="noai">. Those are informal conventions rather than standards, so do not rely on them in place of robots.txt.

Leave a note for next time

A comment at the top of the file, with the date and where the names came from, makes the next review much quicker:

# AI crawler rules reviewed 2026-10-27. Names taken from each vendor's documentation.

Test the file before you publish it

A typo in a user-agent name fails silently: the bot you meant to block simply is not matched. Paste your robots.txt into the robots.txt tester, choose GPTBot, ClaudeBot or Google-Extended from the crawler list, and confirm that a few real URLs come back blocked, then check that Googlebot is still allowed. To build the file in the first place, the robots.txt generator writes the groups and the sitemap line for you.

Tools used in this article

Read next