Key takeaways
  • Each crawler follows only the most specific group that matches its user agent, and groups never merge
  • robots.txt controls crawling, not indexing, and it is a convention rather than an enforced access control
  • User-triggered fetchers may not follow robots.txt the way automatic crawlers do, so check your server logs

If you want to control which AI crawlers read your site, robots.txt is still the main tool you have. It is a plain text file at the root of your host, and it tells well-behaved crawlers which paths they may fetch. You name a crawler with a User-agent line, then list Allow and Disallow rules underneath it. The major AI operators, including OpenAI, Anthropic, Perplexity and Google, publish the names of their crawlers, and most of them say their automatic crawlers respect robots.txt. The file takes five minutes to write. It is also easy to get wrong in ways that quietly hurt your search visibility, and the mistakes are hard to notice because nothing errors out.

The honest answer to "should I block AI crawlers?" is that it depends on which kind of crawler you mean. Training crawlers collect content to build or improve models. Search-index crawlers fetch pages so that an AI search product can find and cite them. User-triggered fetchers run when a person asks an assistant to open a link right now. These three groups behave differently and have different consequences if you block them, and a single blanket rule treats all of them as one. The rest of this article covers the crawler names, how group matching works, the mistakes that catch people out, and a process for writing a file and checking that it does what you think.

The crawlers you are likely to see

The names below are a snapshot of what operators publish at the time of writing. Operators rename and add agents, so treat the vendor's own documentation as the source of truth and recheck it before you rely on any single token.

OpenAI runs at least three agents that matter here. GPTBot is the one most people associate with training. OAI-SearchBot fetches pages for ChatGPT's search features, and OpenAI has described it as separate from training. ChatGPT-User handles fetches that happen because a person asked ChatGPT to look at a page. Blocking one of these does not automatically block the others, so a rule for GPTBot tells you nothing about the search agent.

Anthropic publishes ClaudeBot, which it describes as a crawler for training-related collection, and Claude-User, which handles user-initiated retrieval. Anthropic has also documented other agent names over time, so check its current crawler page rather than copying a list from an older article.

Perplexity uses PerplexityBot for indexing and Perplexity-User for fetches made on a user's behalf. Perplexity has been the subject of public complaints that some fetches did not match its declared behavior. Cloudflare, among others, has published analysis alleging that some traffic came from undeclared crawlers, and Perplexity has disputed those claims. Whatever you conclude from that debate, it is a reminder that a user agent string is a claim, not proof.

Google is the tricky one. Googlebot is the crawler behind Google Search, and blocking it removes you from Search. Google-Extended is different. It is a control token, not a separate crawler that visits your pages. Google says it governs whether content that Googlebot has already crawled may be used for Gemini training and grounding. Blocking Google-Extended leaves your Search presence alone, while blocking Googlebot does not just affect AI features. It affects everything.

Bingbot is Microsoft's crawler for Bing. Bing's index is also used by some other products, so blocking Bingbot can have effects beyond classic Bing results. Those downstream effects vary, and you should check what you are trading away before you add a rule.

How groups and precedence work

The Robots Exclusion Protocol was standardized as RFC 9309 in 2022, and most major crawlers follow it closely. The file is made of groups. A group begins with one or more User-agent lines and continues with Allow and Disallow rules until the next User-agent line that starts a new group. A crawler looks for the group whose user agent token most specifically matches its own name. If it finds one, it follows that group. If it finds none, it falls back to the group for the wildcard, which means every crawler.

The part people miss is that groups do not stack. A crawler reads one group and ignores the rest. If you write a wildcard group with five rules and a Googlebot group with one rule, Googlebot follows only its own group and none of the wildcard rules apply to it. The same is true for every other crawler that has a named group of its own.

Within a group, the rule that decides a URL is the one with the longest matching path. If an Allow and a Disallow both match and are the same length, the Allow wins. This is why you can block a directory and carve out one subpath inside it, provided the Allow path is longer than the Disallow path that covers it.

Here is an example that blocks a drafts folder for most crawlers while keeping one subfolder open:

User-agent: *
Disallow: /drafts/
Allow: /drafts/launch-notes/

User-agent: Googlebot
Disallow: /drafts/

A generic crawler reads the wildcard group. It sees /drafts/ blocked, but the longer Allow for /drafts/launch-notes/ overrides it for that subfolder, so the notes stay crawlable. Googlebot reads only its own group, which has no exception. It is blocked from all of /drafts/, including the notes. If you intended the exception to apply to Google too, you have to repeat it inside the Googlebot group. Writing it once at the top and assuming it applies everywhere is the mistake this example is meant to show.

Path matching is prefix matching and is case-sensitive. A rule for /private also blocks /private-notes and /private.html, because the paths start with the same characters. Adding a trailing slash, as in /private/, narrows the match to the directory. Major crawlers also support the asterisk as a wildcard and the dollar sign as an end-of-URL anchor, but those characters were not part of the original 1990s specification, so do not assume that every small crawler honors them.

An empty Disallow line means nothing is blocked for that group. A Disallow of a single slash blocks the whole site. These two lines look almost identical in a quick scan, and swapping them is a common source of accidental blocks.

The wildcard trap that catches Googlebot

The most damaging robots.txt mistake is a wildcard group that blocks too much, combined with a named group for Googlebot that is written for some other purpose. Consider this file, which someone might write after deciding to keep Googlebot away from internal search result pages:

User-agent: *
Disallow: /admin/
Disallow: /search

User-agent: Googlebot
Disallow: /admin/

The writer probably meant to add a Google-specific rule on top of the general one. What the file actually does is give Googlebot its own complete rule set, which contains only the /admin/ line. Googlebot no longer inherits the Disallow for /search, so it is free to crawl your internal search pages, which may be thin, duplicative and full of parameters. Nothing errors. The file looks reasonable on review. The problem only shows up later, as crawl budget spent on junk pages or as search result pages appearing in the index.

The reverse trap is just as common. A site that wants to block everything except one section writes a wildcard group with Disallow of a single slash, then forgets that Googlebot falls back to the same group. If there is no Googlebot group, Googlebot is blocked everywhere, and search traffic falls off a cliff. A quick test before deployment prevents this, and the verification steps later in this article include one.

The lesson is simple. Every named crawler you care about needs a complete group, or you need to accept that it inherits the wildcard group and nothing else. Writing the file with that model in mind is more important than writing it quickly.

Crawling is not indexing

robots.txt controls whether a crawler may fetch a URL. It does not, by itself, control whether that URL can appear in search results. These are separate steps, and conflating them causes persistent confusion.

Suppose you block a page in robots.txt. Search engines will generally not fetch it, so they will not see its contents, its meta tags or any noindex directive on it. If other sites link to that page, the URL can still appear in results, typically with no snippet and sometimes with a generic description, because the engine knows the URL exists but has never been allowed to read the page. For a page you want out of the index, the reliable approach is to allow crawling and serve a noindex instruction, either in a robots meta tag or in an X-Robots-Tag HTTP header. The crawler has to be able to fetch the page to see that instruction, so blocking the same page in robots.txt defeats it.

This matters a great deal for AI search, because the logic is the same for the AI agents. If you block OAI-SearchBot or PerplexityBot, you may stop those agents from reading the page, which affects whether the page can be cited. It does not necessarily remove the page from every index that might already hold a copy, and it does not undo copies that were collected earlier. Blocking is a forward-looking decision about future fetches, and it does not clean up the past.

Google's Google-Extended token is worth a second look here because it is so often misunderstood. Blocking it is a way to say that Googlebot-collected content should not be used for Gemini training or grounding. It is not a way to hide your pages from Search. If you want to prevent Search inclusion, you need to think about Googlebot and about noindex, not about Google-Extended. Many site owners who add the Google-Extended rule believe they have opted out of Google's AI search, and they have not done what they think.

Hosts, subdomains and caching

Robots.txt applies per host, per protocol and per port. The file at the main host governs that host only. It does not govern blog.example.com, shop.example.com or the insecure version of the same host. Each of those needs its own file at its own root. Sites that run a blog on a subdomain, or a documentation site on a separate host, often have a robots.txt on the main domain that is perfectly tidy and a subdomain that has no file at all, or has one left over from a template. Check every host you serve, not just the primary one.

Serve the file directly. Redirects are followed by many crawlers, but a long redirect chain, a login wall or a page that returns HTML instead of plain text makes the file unreliable. The response should be a 200 with the rules in the body. A file that returns a 404 generally means no restrictions. A file that returns server errors is a different matter. Google documents that persistent server errors on robots.txt can cause it to hold back crawling of the site until the file is reachable again, so a flaky origin server can do more damage than a bad rule.

Caching introduces lag. Google documents that it may cache robots.txt for up to about a day, and other crawlers choose their own refresh schedules. That means a change you deploy at noon may not affect every crawler until the following day, and some may take longer. This is a reason to make changes deliberately and to avoid toggling rules back and forth in a single afternoon, because you will not be able to tell which version a given crawler saw when. If you need a change to take effect quickly for a sensitive path, you need a server-side control, such as authentication or a block at the edge, rather than a robots.txt edit.

Advisory, not enforcement

robots.txt is a convention. The RFC says so directly, and it is not an access control mechanism. A crawler that ignores the file will simply fetch what it likes, and nothing in the protocol stops it. Well-behaved crawlers read the file and comply. Badly behaved ones do not, and some have been accused of disguising themselves with browser-like user agents or rotating addresses.

There is a practical consequence you should take seriously: robots.txt is public. Anyone can open the file and read it. If you list a sensitive directory there to keep crawlers out, you have also told every reader exactly where that directory is. Do not put secrets, private exports or unreleased pages behind a robots.txt rule and call that protection. Use authentication for private content, and use server-side rules for anything that must not be served to an unauthenticated visitor, whatever the user agent.

User-triggered fetchers raise a separate question. When a person asks an assistant to open a page, the request is made on that person's behalf, and some operators have said that these user-initiated fetches are not governed by robots.txt in the same way that automatic crawling is. The reasoning is that the fetch resembles a person opening a link in a browser. We would not assume that every operator behaves this way, and we would not assume that any operator behaves perfectly. Treat a robots.txt rule for a user-triggered agent as a statement of your preference that the operator may or may not honor, and back it up with server-side controls if the page truly must not be fetched.

Stated plainly, robots.txt works well for the crawlers that choose to cooperate, which in practice is most of the large operators, and it does nothing to stop the rest. Your job is to write rules that say what you want, to verify that the cooperative crawlers follow them, and to use stronger tools for anything that matters more than a convention.

Checking what really happens

The file is only useful if it does what you intend, and the best evidence comes from your server logs rather than from the file itself. Filter your access logs by user agent for the crawlers you have blocked or allowed, and look at the status codes they receive. If a crawler you meant to block is returning 200 responses, either the rule is wrong, the crawler is not honoring it, or the crawler is using a different token than you assumed. If a crawler you meant to allow is getting 403 or 404 responses across a whole section, the rule is probably blocking more than you realized.

User agent strings can be spoofed by anyone, so a log line that says a request came from GPTBot is a claim, not a confirmation. Several operators publish the IP ranges their crawlers use, and Google documents a method of verifying Googlebot with reverse and forward DNS lookups. Checking requests against published ranges or verification methods is more work, but it is the difference between knowing and assuming. If the sample is large enough, a short script that groups requests by user agent and by whether they match the published ranges will tell you a lot in an afternoon.

This is one area where a dedicated tool helps. InstantIndexingPro logs which bots fetched each URL, which makes it easier to see whether a rule you wrote is being followed in practice, and to notice when a crawler appears on a URL you thought was closed. It does not replace reading your own logs or understanding the vendors' documentation, but it does turn a manual check into something you can look at each week.

What to do: write and verify the file

Start by deciding what you want, in plain terms, before you write any syntax. Make a short list for yourself, not for the file: which crawlers should be able to fetch public content for search, which should be blocked from training use, which user-triggered agents you are comfortable with, and which sections of the site should be closed to all of them. Writing the policy first keeps you from building a file by copying rules from a forum post you cannot evaluate.

Next, draft the groups. Give each crawler you care about its own group, even if the rules are identical to the wildcard group. That removes the inheritance trap entirely, because each named crawler reads only the group you wrote for it. Put the wildcard group last or first, whichever you find easier to read, but do not rely on the wildcard to cover a named crawler's needs. Keep the file short. A long file full of old, half-remembered rules is hard to audit and easy to break.

Then test the draft before you deploy it. Google's open-source robots.txt parser, which is available in several languages, lets you feed the file and a set of URLs to the same matching logic Google uses. Run a list that includes your most important pages, your key sections, the paths you intend to block and a few tricky URLs with similar prefixes. Pay close attention to the Googlebot results, because that is where the inheritance trap bites. If you have a staging host, deploy there first and fetch the file as each crawler would see it.

Deploy the file at the root of each host that needs one, and fetch it directly afterward with a plain request. Confirm the status is 200, the content type is plain text, and the body matches what you wrote. Check that the subdomains you forgot about have their own files, or that they deliberately do not. If you use a CDN or an edge cache, confirm that it is not serving an old copy of the file, because a stale cache can hold a bad rule in place long after you fixed the origin.

Finally, verify in logs and keep checking. Over the following week, look at the requests from each named crawler and their response codes. Expect caching lag, so do not judge the change in the first few hours. Set a recurring reminder to recheck the vendor documentation, because the crawler names and behaviors do change. If you find a crawler ignoring your rules, decide whether the cost is worth a server-side block, and treat that decision as a separate policy choice rather than a robots.txt problem. Write down what you changed and why, so that the next person who edits the file can tell an intentional rule from an accident.