AI crawlers now fetch website content at scale, collecting pages for training data and for AI answer engines. Plenty of site owners are happy to be crawled by search engines but would rather keep AI crawlers out. The tool you have for that is the robots.txt file: the same file that has always carried crawling instructions. Used properly, it lets you name the crawlers you want to stop and tell them, in the standard format, to fetch nothing from your site.

This guide builds that file with the free Robots.txt Generator on Ovatly. It also states the limit plainly: robots.txt controls crawling by instruction. It is not a lock, not a security measure, and not a way to remove pages from search results.

Contents

  • Quick answer
  • What robots.txt actually controls
  • Why AI crawlers get named groups, not the * group
  • The name problem: tokens and placeholders
  • How to build the file, step by step
  • Worked example: two AI crawlers blocked, everyone else unaffected
  • Limitations: what this file cannot do
  • Common mistakes
  • FAQs
  • Conclusion

Quick answer

For each AI crawler you want to stop, create a rule group that names that crawler's user agent and give it a single rule, Disallow: /, which tells it not to fetch any path on your site. Leave the * group for the crawlers you still welcome, with your normal rules in it. Build the groups in the Robots.txt Generator, copy or download the file, and place it at the root of your domain. Then accept the honest limit: the file instructs, it does not enforce. Crawlers that follow robots.txt will stay away; it cannot stop one that ignores it, and it cannot remove anything from search results.

What robots.txt actually controls

A robots.txt file is a set of rule groups. Each group names the crawlers it applies to, then lists paths those crawlers should not fetch (Disallow) and paths reopened inside a blocked area (Allow). When both match a path, the longest pattern wins. That is the whole mechanism: instructions about fetching, written in a format crawlers know how to read.

Two boundaries follow. First, the file controls crawling, not indexing: a page a crawler never fetched can still appear in search results if other sites link to it, shown as a bare URL without a snippet. Second, the file is not security. It sits in public at the root of your domain, anyone can read it, and it puts no barrier in front of anything. It works because crawlers that respect the standard choose to follow it. Even a simple crawl-delay is honoured by some crawlers, such as Bing, and ignored by Googlebot. Compliance is the crawler's decision, every time.

Why AI crawlers get named groups, not the * group

The tempting shortcut is one group for everyone: User-agent: * with Disallow: /. That does stop AI crawlers. It also stops every search engine, every preview bot and every other crawler, because the * group applies to all crawlers. Your site would vanish from the crawl queues you actually depend on.

Named groups exist for exactly this situation. The generator builds the file from groups, and its steps include adding another group when one crawler needs different rules. So the general group keeps your ordinary rules for everyone, and each AI crawler gets its own small group whose only rule is the full block. The search engines never see the block, because it was never addressed to them.

The name problem: tokens and placeholders

A group applies to the crawlers named in it, identified by their user agent token: the short name a crawler announces itself with. Get the token wrong and the rule is addressed to nobody; the real crawler will not recognise itself in your file.

This guide cannot give you a list of real AI crawler tokens, because the honest list is the one each crawler operator publishes for its own bot, and operators occasionally change them. So the examples below use clearly labelled placeholders, ExampleAIBot and SampleCrawlerAI, which are invented names that match no real crawler. When you build your real file, replace each placeholder with the exact token from the operator's own documentation, spelled exactly as published. The method does not change; only the names do.

How to build the file, step by step

  1. Open the Robots.txt Generator. In the first group, list the user agents the general rules apply to. Use * for all crawlers, and add your normal Disallow paths, such as an admin area or a temporary folder, one per line.
  2. Add another group. In its user agent field, enter the exact token of the first AI crawler you want to block, replacing the placeholders used in this guide.
  3. In that group, add a single Disallow path: /. That one prefix covers every path on the host, so the named crawler is told to fetch nothing.
  4. Repeat with a further group for each additional AI crawler token, each with the same single Disallow: / rule.
  5. Add your sitemap URL, then copy or download the generated robots.txt and place it at the root of your domain. Test it before you rely on it: the Robots.txt Tester on this site will check the generated content against real paths from your site.

Worked example: two AI crawlers blocked, everyone else unaffected

Say your ordinary rules block an admin area and a temporary folder for everyone, and you want two AI crawlers, shown here with the placeholder tokens ExampleAIBot and SampleCrawlerAI, to fetch nothing at all. The generator produces a file like this:

User-agent: ExampleAIBot
Disallow: /

User-agent: SampleCrawlerAI
Disallow: /

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

Sitemap: https://example.com/sitemap.xml

Read it as three separate conversations. The first two groups speak to one crawler each and say: fetch nothing. The third speaks to every other crawler and says: crawl normally, but stay out of /admin/ and /tmp/. A search engine reading this file never encounters a rule that blocks it from your content.

Limitations: what this file cannot do

The file cannot force anything. A crawler that ignores robots.txt will fetch your pages anyway, and your only evidence will be in your server logs. It cannot undo crawling that has already happened, and it cannot remove pages from search results: blocking is about fetching, and deindexing needs a noindex tag or removal of the page. It cannot hide anything, because the file is public, which is also why you should never list secret paths in it. It does not cover subdomains: each subdomain needs its own file with its own groups. And softer settings are unreliable across crawlers: a crawl-delay may be honoured by one crawler and ignored by another, so it is no substitute for a block when a block is what you mean.

If keeping content away from a crawler is critical rather than a preference, treat robots.txt as the polite first step it is, and look at server-side access controls as well.

Common mistakes

  • Blocking the * group. Disallow: / under User-agent: * stops search engines along with the AI crawlers. Name the crawlers you mean.
  • Guessing the token. A group applies only to the crawlers named in it. A misspelled token blocks nobody; copy the exact token the operator publishes.
  • Expecting removal. Blocking crawling does not remove pages from search results and does not recall content already fetched.
  • Listing sensitive paths. The file is public. Never advertise the location of anything secret in it.
  • Forgetting subdomains. Rules on your main domain do not extend to a subdomain; each host needs its own file at its own root.

FAQs

Can robots.txt force an AI crawler to stop crawling my site? No. robots.txt controls crawling by instruction, not by force, and it is not a security measure. A crawler that follows the file will honour a Disallow rule in its group; a crawler that chooses to ignore the file is not stopped by it.

Should I block AI crawlers in the * group? No. The * group applies to all crawlers, including the search engines you probably still want. Give each AI crawler its own named group instead, so the other crawlers keep following the general rules.

Does blocking a crawler remove my pages from search results? No. robots.txt controls crawling, not indexing. A disallowed page can still appear in search results if other sites link to it, usually shown as a URL without a snippet.

Will a crawl-delay slow AI crawlers down instead of blocking them? Not reliably. Crawl-delay is honoured by some crawlers, for example Bing, but ignored by Googlebot, so support varies from crawler to crawler.

Do subdomains need their own robots.txt file? Yes. The file must live at the root of the host, and each subdomain needs its own file, so rules written for your main domain do not cover a subdomain.

Conclusion

Stopping AI crawlers with robots.txt is a naming exercise: one group per crawler, the exact published token, and a single Disallow: /. Build it with the Robots.txt Generator, test the output, and keep your expectations matched to what the file is: a standard instruction that well-behaved crawlers follow, not a barrier. If you are also setting up environments you want kept entirely out of crawl queues, the companion guide on how to write robots.txt for a staging site covers the full-block pattern for test sites. More guides like this one live in the SEO Tools guides archive.