How to Use Robots.txt to Control AI Crawlers

Robots.txt is a plain text file at your domain root (yoursite.com/robots.txt) that tells web crawlers which parts of your site they may access. In 2026, it also controls a new category of visitor: AI crawlers. These bots fall into two groups with two completely different jobs – search/citation crawlers (like OAI-SearchBot, Claude-SearchBot, and PerplexityBot) fetch your pages so AI engines can cite you in live answers, while training crawlers (like GPTBot, ClaudeBot, and CCBot) fetch your pages to train the underlying model. You can allow one and block the other with separate rules in the same file. Block the wrong bot, and you can disappear entirely from an AI engine’s answers, even while ranking normally in Google.
If you want your content to show up in ChatGPT Search, Perplexity, Google AI Overviews, or Copilot, robots.txt is the first gate those answers pass through. Get it wrong, and no amount of good content will save you, the crawler never even reaches the page.
What Robots.txt Actually Does
Robots.txt has run the web’s crawler traffic for over two decades. A few fundamentals still apply, AI bots included:
It lives at the root of your domain – https://yoursite.com/robots.txt – and nowhere else.
It’s made up of groups, each starting with one or more User-agent lines followed by Allow or Disallow rules.
It is opt-out, not opt-in. No file, or an empty file, means “crawl everything.” You only need rules for what you want to restrict.
Two wildcards work inside paths: matches any sequence of characters, and $ anchors the end of a path (so Disallow: /.pdf$ blocks every PDF on the site).
A Sitemap: line can point crawlers to your sitemap and sits outside any group.
This structure follows the Robots Exclusion Protocol standard maintained by the IETF, which is the closest thing the web has to an official spec for how robots.txt should be written and interpreted. That much hasn’t changed. What’s new is the list of user-agents worth naming individually.
The Mistake That Makes Sites Invisible to AI Engines
Most robots.txt problems in 2026 come down to one misunderstanding: treating “AI crawler” as a single category.
It isn’t. Every major AI company runs at least two separate bots:
A training crawler, which harvests pages to feed into future model training runs.
A search or citation crawler, which fetches pages in real time so the AI engine can quote or link you in an answer.
These are governed by separate User-agent rules. Allowing or blocking one has no effect on the other. That distinction matters because a lot of sites added a blanket “block AI” rule to their robots.txt a couple of years ago – usually named after whichever bot was in the news, without realizing it also cut off the citation crawler for that same engine. The result: the content is fine, the SEO is fine, and the site still never appears in that engine’s answers, because the crawler that would fetch it for citation was never allowed in.
You can, and often should, treat these as independent decisions: keep your content out of model training while staying fully eligible to be cited in AI search.

AI Crawler Reference Table
Here’s the current list of user-agents worth naming explicitly in your robots.txt, what each one does, and how to treat it depending on your goal.

The two rows that trip people up most: GPTBot vs. OAI-SearchBot, and ClaudeBot vs. Claude-SearchBot. Same company, same “AI” label in casual conversation, entirely different jobs.
Related Reading: AI Discovery Explained: How to Prepare Your Website for AI Search
How Robots.txt Matching Actually Works
Before writing rules, it helps to know how a crawler decides which ones apply to it.
Three rules govern this, and getting them wrong is how well-intentioned configs backfire.
A crawler follows exactly one group – the most specific match. If you have a User-agent: GPTBot group and a User-agent: group, GPTBot follows only its own group and ignores the wildcard group completely. It does not inherit anything from . So if you write a GPTBot group that blocks one path, you must also repeat any general rules you want GPTBot to follow, it won’t pick them up from elsewhere in the file.
Within a group, the longest matching rule wins – not the first one written. For a path like /api/public/data, if you have both Disallow: /api/ and Allow: /api/public/, the second rule is longer and wins, so the path is allowed. Order in the file doesn’t decide it; specificity does.
No matching rule means the path is allowed. Because robots.txt is opt-out by default, anything you haven’t explicitly restricted is fair game to any crawler.
If you want to sanity-check a live file, paste it into a robots.txt testing tool, Google’s own robots.txt report in Search Console is a reliable option, and check a few real paths against a few real user-agents before publishing.
Two Ready-to-Use Robots.txt Templates
Template A – Allow AI citations, block AI training
Use this if you want to appear in ChatGPT, Perplexity, Claude, and Google AI Overviews, while keeping your content out of raw model training sets where possible.
# Allow AI search/citation crawlers
User-agent: OAI-SearchBot
Allow: /
User-agent: PerplexityBot
Allow: /
User-agent: Claude-SearchBot
Allow: /
User-agent: Bingbot
Allow: /
# Block AI training crawlers
User-agent: GPTBot
Disallow: /
User-agent: ClaudeBot
Disallow: /
User-agent: Google-Extended
Disallow: /
User-agent: CCBot
Disallow: /
User-agent: Bytespider
Disallow: /
# Everyone else
User-agent: *
Allow: /
Sitemap: https://yoursite.com/sitemap.xmlTemplate B – Block all AI crawlers, training and search alike
Use this only if you’re comfortable losing visibility in AI-generated answers entirely – for example, on a site where you don’t want any automated summarization of your content.
User-agent: GPTBot
Disallow: /
User-agent: OAI-SearchBot
Disallow: /
User-agent: ClaudeBot
Disallow: /
User-agent: Claude-SearchBot
Disallow: /
User-agent: PerplexityBot
Disallow: /
User-agent: Google-Extended
Disallow: /
User-agent: CCBot
Disallow: /
User-agent: Bytespider
Disallow: /
User-agent: *
Allow: /
Sitemap: https://yoursite.com/sitemap.xmlReplace yoursite.com with your actual domain, and adjust each group to match your policy. There’s no setting that lets you be cited by an AI engine without allowing its search crawler, if visibility is the goal, that crawler has to stay on Allow: /.
The Silent Mistakes That Block You Even With a “Correct” Robots.txt
Robots.txt is necessary but not sufficient. Even a perfectly written file won’t help if any of the following are also true:
noindex or nosnippet tags on pages you want quoted. If a page can’t produce a snippet in regular search, it generally can’t be surfaced in an AI Overview either.
Heavy client-side rendering. If your content only appears after JavaScript runs, many crawlers – AI bots included – never see it. This is a common, invisible failure point on modern single-page apps. Server-render or pre-render anything you want crawled.
CDN or firewall-level blocking. Some bot-protection services block AI crawlers by default at the network layer, which overrides whatever your robots.txt says. If you’re allowed on paper but still absent from AI answers, check your CDN or WAF settings first.
No sitemap submitted to Bing Webmaster Tools. Both ChatGPT and Copilot lean partly on Bing’s index, so a stale or missing Bing sitemap can quietly limit citation reach even when robots.txt is correct.
Originally published at https://increativeweb.com on August, 31 2026.




Comments