Technical SEO

robots.txt and AI Crawlers: What to Block and What to Allow

robots.txt and AI crawlers intersect in one small root file that decides which bots may fetch your pages. Googlebot drives Search and AI Overviews; GPTBot, ClaudeBot, CCBot and Google-Extended relate to model training; PerplexityBot powers retrieval. I set separate rules for each in my WordPress builds at webdev-saif.com so being cited does not depend on surrendering training rights.

By Saif Al Jahanwebdev-saif.com

What robots.txt actually controls

robots.txt is a plain-text file at the domain root, for example https://webdev-saif.com/robots.txt, served with HTTP 200. It groups rules by User-agent and tells compliant crawlers which paths they may fetch. It governs crawling, not indexing, ranking or model training that already happened. A Disallow rule stops future fetches; it does not retract a URL from the Google index or remove content from an old Common Crawl snapshot. The file is advisory: well-behaved bots obey it, while scrapers ignore it, so it is a policy statement rather than enforcement. A missing file or a 404 is usually read as allow-all, whereas a persistently failing 5xx response can be read as disallow-all and quietly damage visibility. To remove a page from results you need noindex or a removal request, never Disallow alone.

  • Lives at the domain root as plain ASCII text and must return HTTP 200
  • Controls fetching (crawling), not indexing, ranking or training already done
  • Advisory: compliant bots obey it; scrapers and bad actors ignore it
  • A 404 usually means allow-all; persistent 5xx can be read as disallow-all
  • Removing an indexed URL requires noindex or a removal request, not Disallow

The user-agent tokens worth knowing

Six tokens matter in practice. Googlebot is the search crawler used by Google and the source of the index that AI Overviews ground on, so blocking it costs both Search traffic and overview eligibility. GPTBot is the OpenAI crawler for collecting training data and is distinct from OAI-SearchBot, which feeds ChatGPT search, and ChatGPT-User, which fetches a page after a user asks. ClaudeBot is the Anthropic training crawler, with related tokens such as Claude-Web and anthropic-ai. PerplexityBot indexes pages for the Perplexity answer engine; Perplexity-User fetches on demand. Google-Extended is not a crawler at all but a control token: it opts content out of Gemini training and some AI Overviews grounding without touching Search indexing. CCBot crawls for Common Crawl, a public corpus reused by many unrelated training pipelines.

  • Googlebot: Google Search index, also the basis for AI Overviews grounding
  • GPTBot: OpenAI training crawler, distinct from OAI-SearchBot and ChatGPT-User
  • ClaudeBot: Anthropic training crawler, related tokens Claude-Web and anthropic-ai
  • PerplexityBot: Perplexity index crawler; Perplexity-User fetches on demand
  • Google-Extended: a control token for Gemini training/grounding, not a crawler
  • CCBot: Common Crawl corpus, reused by many unrelated AI training pipelines

Write a policy that separates search from training

Write one group of rules per bot and keep the allow rules explicit rather than implied. Googlebot should stay allowed if you care about Search or AI Overviews. GPTBot, ClaudeBot and CCBot can be blocked as a group with a single Disallow: / line. Google-Extended needs its own group because it controls training and grounding separately from the Search index. PerplexityBot should be allowed if you want your pages fetchable when Perplexity answers a question. An empty Disallow means allow everything. Several User-agent lines can share one rule block, and the most specific matching group wins for Googlebot, so put exact bot names before a wildcard. Use * and $ only when you need path-level exceptions, such as disallowing a specific directory.

  • Allow Googlebot: it drives Search and the grounding used by AI Overviews
  • Block GPTBot, ClaudeBot and CCBot if you opt out of training corpora
  • Block Google-Extended separately to avoid Gemini training without losing Search
  • Allow PerplexityBot if you want pages retrievable in Perplexity answers
  • Group multiple User-agent lines under one rule set; most specific match wins
  • Use * wildcards and $ end anchors only for path-level exceptions

The blocking-versus-citation trade-off

AI visibility arrives through two routes. Training puts your content into the parameters of a model; retrieval fetches a page at answer time and cites it. GPTBot, ClaudeBot, CCBot and Google-Extended affect the first route. Googlebot, PerplexityBot, OAI-SearchBot and on-demand user fetchers affect the second. Blocking training crawlers usually reduces the chance that a model knows your facts from training, but rarely breaks live citations, because retrieval still works. Blocking retrieval crawlers can remove you from answer-engine results quickly. The practical target is to keep retrieval open and choose training access deliberately. Remember that a block is not retroactive: models already trained and archived Common Crawl snapshots still contain your text. Document the decision, revisit it as answer engines change, and do not assume that a citation is guaranteed by any setting.

  • Training access: GPTBot, ClaudeBot, CCBot, Google-Extended
  • Retrieval access: Googlebot, PerplexityBot, OAI-SearchBot, ChatGPT-User
  • Blocking training bots rarely removes live citations; blocking retrieval bots often does
  • A block is not retroactive: old models and Common Crawl snapshots keep your text

Implementing the rules in WordPress and PHP

WordPress serves a virtual robots.txt when pretty permalinks are enabled, and the robots_txt filter lets you append rules without a physical file. The default output includes User-agent: *, Disallow: /wp-admin/, an Allow line for admin-ajax.php, and the XML sitemap URL. Append bot groups in PHP from one configuration array so the policy for each crawler has a single definition. A physical robots.txt in the web root also works: the server serves it before WordPress rewrite runs, but never maintain both with conflicting rules. In a custom PHP application, generate the file from the same config rather than hand-editing it on the server. For per-page control use the wp_robots filter added in WordPress 5.7 to emit noindex; that is an index directive, not a crawl directive. Commit the policy to version control and review it after any SEO plugin change.

  • add_filter("robots_txt", ...) appends rules to the WordPress virtual file
  • Or ship a physical /robots.txt; a static server serves it before WordPress rewrite
  • Generate the file from one PHP config array, not scattered plugin settings
  • Use the wp_robots filter for per-page noindex, not Disallow in robots.txt
  • Commit the policy to version control and recheck after SEO plugin updates

Verify crawler access before and after a change

Verify the served file rather than the file on disk. Run curl -s https://webdev-saif.com/robots.txt and confirm a 200 response and the exact rule text, including line breaks. In Google Search Console, the robots.txt report and URL Inspection show whether Googlebot is allowed. For other bots, grep access logs for GPTBot, ClaudeBot, PerplexityBot and CCBot user-agent strings, while remembering that user-agent strings can be spoofed. Google-Extended has no dedicated report, so inspect the text itself. After a change, allow a recrawl window before judging the result; a new Disallow does not instantly purge an indexed URL. Because one file governs the whole domain, validate it on staging before deploying. In my Mymensingh builds I keep a short checklist so a plugin update cannot silently rewrite the policy.

  • curl -s https://webdev-saif.com/robots.txt confirms status 200 and exact rules
  • Google Search Console robots.txt report and URL Inspection for Googlebot access
  • Grep access logs for GPTBot, ClaudeBot, PerplexityBot and CCBot user-agents
  • Check Google-Extended by inspecting the file text; there is no dedicated report
  • Allow a recrawl window before judging the effect of a Disallow change

Mistakes I see most often

Most problems come from copying a block-everything template and then wondering why AI answers omit the site. Other recurring errors: treating Disallow as a deindex tool, assuming Google-Extended blocks Googlebot, or assuming GPTBot and OAI-SearchBot are the same crawler. Some teams treat llms.txt as a replacement for robots.txt; it is an optional discovery proposal with no authority to grant or deny crawling. User-agent tokens are case-insensitive but path rules are case-sensitive, so test the exact path. Watch for plugin settings that append their own groups and for CDN or WAF rules that block bots regardless of what robots.txt says. A single reviewed file, kept in version control, avoids most of this. Plain language in the policy comments matters too: record why each bot is allowed or blocked so the next person does not undo a deliberate choice.

Frequently asked questions

Does blocking GPTBot stop ChatGPT from citing my site?

Not necessarily. GPTBot collects content for model training, while ChatGPT search and browsing use separate systems such as OAI-SearchBot and user-triggered fetches. Blocking GPTBot removes you from future training collection but usually does not stop live retrieval and citation. If citations matter, keep retrieval agents allowed and make pages answer-first with matching structured data.

What is Google-Extended and is it a crawler?

It is a control token, not a crawler that fetches pages. Adding a Google-Extended group with Disallow: / tells Google not to use your content for Gemini training and certain AI Overviews grounding, while leaving Search indexing by Googlebot unchanged. Use it when you want Search traffic but want to opt out of AI training use.

Will Disallow: / remove my pages from Google?

No. Disallow blocks crawling, not indexing. Already-indexed URLs can remain in results, sometimes with a snippet assembled from other sources. To remove a page, add noindex in the meta robots tag or use the URL Removal tool in Search Console. In WordPress, the wp_robots filter adds noindex without touching the crawl policy.

Should I block CCBot?

It depends on your goal. CCBot crawls for Common Crawl, whose snapshots are reused as training data by many unrelated projects. Blocking it has a broad but indirect effect that you cannot attribute to any single model, and it does not erase older snapshots. CCBot does not drive live citations, so it is not the bot to block when protecting answer-engine visibility.

Is llms.txt a replacement for robots.txt?

No. robots.txt is the long-standing crawl-control standard that compliant bots respect. llms.txt is a newer, optional proposal for publishing an AI-friendly summary of a site; no crawler is required to read it and it grants or denies nothing. Use it as a discovery aid alongside robots.txt, never as a substitute for it.

Do AI crawlers actually obey robots.txt?

The major named bots generally respect it as a policy choice, but compliance is voluntary. Scrapers and some automated tools ignore robots.txt entirely, and user-agent strings can be spoofed. If you need enforcement rather than a request, use CDN or WAF rules, rate limits and bot management. Check server logs to see which agents actually request your pages.

Written by Saif Al Jahan, webdev-saif.com · Mymensingh, Bangladesh. Last updated .