How to Block GPTBot and ClaudeBot With robots.txt
The rule is two lines. Knowing whether it's actually working is the part most guides skip.
Blocking an AI crawler from training on your site is a robots.txt rule, the same mechanism that's controlled search-engine crawling since 1994. If you already know how to write a Disallow rule, you already know how to do this — the syntax isn't the hard part. The two things that actually go wrong are: not knowing there's more than one crawler per company, and having no way to confirm the rule is doing anything after you save the file.
Already have a robots.txt? Check your domain on AI Crawler Checker to see what your published file tells each crawler.
The rule itself
User-agent: GPTBot
Disallow: /
User-agent: ClaudeBot
Disallow: /
User-agent: Google-Extended
Disallow: /
RFC 9309 combines multiple groups that match the same crawler token. A crawler uses the wildcard * group only when there is no specific match. Check for an existing group before adding a new one. No standard crawler token means "all AI crawlers."
It's not just one bot per company
| Company | Crawler(s) | What it's for |
|---|---|---|
| OpenAI | GPTBot | Crawls for model training |
| OpenAI | OAI-SearchBot | Used for ChatGPT Search, separately from GPTBot |
| OpenAI | ChatGPT-User | Fetches a page live when a user asks ChatGPT to browse it — a different purpose, and blocking GPTBot does not block this one |
| Anthropic | ClaudeBot | Crawls for model training |
Google-Extended | Controls certain downstream training and grounding uses. It is a policy token, not a separate crawler. |
OpenAI documents GPTBot and OAI-SearchBot as separate controls. Google documents that Google-Extended does not affect Search inclusion or ranking. For Google's generative features in Search, look for the separate control in Search Console.
Confirming the rule actually works
A robots.txt rule is advisory — well-behaved crawlers check it before fetching a page and respect what they find, but nothing on your server enforces it, and a typo in the user-agent name (a stray space, wrong capitalization treated too strictly by a hand-rolled parser, or a rule placed in the wrong group) can silently do nothing. The syntax also has sharper edges than it looks: per the underlying spec, the longest matching path pattern wins when rules conflict, and equal-length ties resolve to allow — so a broad Disallow: / for one crawler can be quietly overridden by a more specific Allow: rule elsewhere in the same file, if you're not tracking pattern length.
Check the status before reading the rules
Open /robots.txt on the public hostname, not a staging host. Check both the HTTP status and the body: a 200 response containing an HTML error page is not the plain-text policy you meant to deploy.
- 404: the policy is unavailable. Under RFC 9309, a crawler may proceed without it.
- 503 or a network failure: the policy is unreachable. A crawler following the RFC must initially treat crawling as disallowed. This is an outage to fix, not a lasting block.
Once the file is served correctly, check the exact bot and path you care about. A rule check explains what the file says; only your server logs show whether a given request arrived. Use authentication to protect private content.
Save a before-and-after record
- Before deploying, run the free checker on your own public hostname. Enter the path you care about, such as
/docs/. - Choose 결과 TXT 저장 (save result as TXT). Keep that copy as your baseline: the file records the time, status, root verdicts, and selected path verdicts separately.
- After deploying, repeat with the same hostname and path. Keep both files. Compare the bot you meant to change and at least one you meant to leave alone.
In this synthetic example, the original policy allows both crawlers. The updated policy adds Disallow: / and Allow: /docs/ to the GPTBot group only.
Crawler Path Before After
GPTBot / allowed blocked
GPTBot /docs/ allowed allowed
OAI-SearchBot / allowed allowed
The root change does not erase the longer exception at /docs/. The TXT file is evidence of what the checker read at a point in time, not evidence of bot behavior. Keep private paths out of any report you share.
AI Crawler Checker fetches your public robots.txt and shows how its rules match bots such as GPTBot, ClaudeBot and Google-Extended. It's a free check of the policy, not proof that a bot complied.
If you're planning a policy change and need examples to adapt, I also sell the AI Crawler Control Playbook. It includes English and Korean guides, five robots.txt templates, and Nginx and Apache examples. You don't need to buy it to use the free checker.
Read the free Chapter 3 preview in Korean before deciding.
Related pages here about a rule that passes a quick check and still fails in practice: Discord embed character limits explained, where every field is under its own limit and the 6,000-character total still rejects the embed, and Secret Santa generator vs. a random wheel, where a shuffle sorted with a random comparator makes some pairings more likely than others.