robots.txt
Also known as: Robots Exclusion Protocol
Definition
robots.txt is a plain-text file at the root of a site that tells crawlers which URLs they may fetch, using User-agent, Allow and Disallow rules. It is standardised as RFC 9309.
Explanation
The Robots Exclusion Protocol was published by the IETF as RFC 9309 in 2022. Crawlers match their user-agent token to a group of rules; the most specific matching rule wins. Under the RFC, a 4xx response for the file lets crawlers fetch anything, while a 5xx response means they should treat the whole site as disallowed.
robots.txt controls crawling, not indexing, and compliance is voluntary. Google notes it is not a mechanism for keeping a page out of search; use noindex for that.
Why it matters for your site
One line in robots.txt can decide whether ChatGPT, Claude and Perplexity can cite you. It is the first thing to check when a site is missing from AI answers.
Related guides
- robots.txt for AI crawlers: publish a file that returns 200Serve /robots.txt with HTTP 200 and explicit rules for AI search bots, training bots and your sitemap, so ChatGPT, Claude and Perplexity crawl as you intend.
- Allow AI search bots in robots.txtBlocking OAI-SearchBot, Claude-SearchBot or PerplexityBot keeps your store out of AI answers. Allow AI search and user bots in robots.txt for your key pages.
- XML sitemap for AI crawlersA sitemap lets search and AI crawlers find every product, not only pages linked from your homepage. Publish valid XML and add a Sitemap: line to robots.txt.