AI Visibility Academy · Chapter 03
Write robots.txt rules for AI crawlers
A robots.txt file is read in groups. Each group starts with one or more User-agent lines followed by Allow and Disallow rules, and a crawler obeys only the group that names it, falling back to User-agent: * when no group does. So give each AI crawler you want to treat differently its own group, and repeat in that group any catch-all rules you still want it to follow.
A pattern that does what most sites intend
This file lets AI search crawlers in, keeps two training crawlers out, and keeps everyone away from private pages:
User-agent: *
Disallow: /account/
Disallow: /checkout/
User-agent: OAI-SearchBot
User-agent: Claude-SearchBot
User-agent: PerplexityBot
Disallow: /account/
Disallow: /checkout/
User-agent: GPTBot
User-agent: ClaudeBot
Disallow: /
Naming the search crawlers isn't strictly needed, since they would fall back to * anyway. It records the decision, and it shows the rule that catches people out: Google's specification says a named group and the * group are not combined. Write User-agent: OAI-SearchBot with Allow: / and nothing else, and you have just opened your account pages to it.
The details that cause surprises
- Longest match wins. When an
Allowand aDisallowboth match a URL, the longer path wins. On a tie, Google uses the less restrictive rule. - Paths are case-sensitive; crawler names are not.
/Blog/and/blog/are different paths, while RFC 9309 has crawlers matchGPTBotandgptbotalike. - One file per host. A robots.txt on
example.comdoesn't covershop.example.com. Each subdomain needs its own. - Changes take a day. Google generally caches robots.txt for up to 24 hours. OpenAI and Perplexity give similar timings for their crawlers.
- Errors matter. Google treats a missing file (a 404) as no restrictions, but if robots.txt returns a server error, Google stops crawling the site for a while.
What robots.txt can't do
It is a request, not a lock. RFC 9309 says the rules are not a form of access authorization: well-behaved crawlers follow them, and some fetchers that act on a user's request don't, as the lesson on the AI crawlers and what each one is for shows.
It also doesn't remove a page from Google. Google can still index a disallowed URL and show it without a snippet. If you need a hard refusal, that happens at your server or CDN, covered in when your CDN or firewall blocks AI bots.
Where to start
Open your live robots.txt and label each group with the crawler and the decision behind it. For every named AI crawler, check that its group repeats the private paths from *. Fix what's missing, wait a day, then read the live file again to confirm the change is what's being served.
Sources
- Google, "How Google Interprets the robots.txt Specification", Aug 31, 2026 (opens in a new tab)
- IETF, "RFC 9309: Robots Exclusion Protocol", Sep 2022 (opens in a new tab)
- OpenAI, "Overview of OpenAI Crawlers", accessed Oct 8, 2026 (opens in a new tab)
- Perplexity, "Perplexity Crawlers", accessed Oct 8, 2026 (opens in a new tab)
- Google, "Introduction to robots.txt", Dec 10, 2025 (opens in a new tab)