AIO Copilot

What is robots.txt?

Robots.txt is a plain text file at the root of a site that tells crawlers which URLs they may fetch. It controls crawling, not indexing: a blocked URL can still appear in Google if other pages link to it.

Well-behaved crawlers check one file before fetching anything else on a host: /robots.txt. The file holds groups of rules. Each group starts with a user-agent line naming a crawler, followed by allow and disallow lines listing URL paths. The format was first defined by Martijn Koster in 1994 and became an internet standard, RFC 9309, in September 2022, with three Google employees among its four authors. The RFC is clear about its limits: the rules are not a form of access authorization. Polite crawlers obey them, and nothing forces anyone else to.

Google's robots.txt specification adds its own details. The file must sit in the top-level directory and only covers the protocol, host and port it is served from, so www.example.com and shop.example.com each need their own. Google reads four fields, user-agent, allow, disallow and sitemap, and ignores others such as crawl-delay. It enforces a 500 KiB size limit and ignores content past it, generally caches the file for up to 24 hours, and when rules conflict it applies the most specific one, or the least restrictive one when they are equally specific. Sitemap lines must use a full URL, including the protocol and host. Our technical SEO audit checklist covers where robots.txt fits in a site audit.

Does robots.txt stop a page from being indexed?

No. Google's introduction to robots.txt says the file is used mainly to manage crawler traffic and is not a mechanism for keeping a web page out of Google. A disallowed URL can still be indexed if other pages link to it, usually shown without a description. To keep a page out of results, use a noindex rule or password protection, and leave the page crawlable: Google's noindex documentation warns that if robots.txt blocks the page, the crawler never sees the noindex rule and the page can still appear in search results.

What happens if robots.txt is missing or broken?

A missing file means no restrictions, but a server error can halt crawling. Google treats any 4xx response for robots.txt, except 429, as if no file existed, and crawls freely. A 5xx response is different: for the first 12 hours Google stops crawling the site while it keeps trying to fetch the file, then uses the last good copy for up to 30 days. A one-line mistake can also go a long way: "Disallow: /" blocks the whole site for whichever crawler the group names. Test changes in the free robots.txt validator before publishing them.

How do you block AI crawlers with robots.txt?

Give each company's documented user agent its own group, and check what each token controls, because blocking training does not always remove you from AI answers:

  • OpenAI: GPTBot collects content to train its models; OAI-SearchBot surfaces sites in ChatGPT search, and blocking it keeps a site out of ChatGPT search answers, though it can still appear as a navigational link; ChatGPT-User fetches pages on a user's request, and OpenAI says robots.txt rules may not apply to it
  • Google: Google-Extended controls whether content is used to train Gemini models and for grounding in Gemini Apps and Vertex AI; Google says it does not affect inclusion or ranking in Google Search
  • Anthropic: ClaudeBot collects training data, Claude-User fetches pages when people ask Claude questions, and Claude-SearchBot improves Claude's search results; Anthropic says blocking either of the last two may reduce a site's visibility in answers

AI Overviews and AI Mode have no separate token. Google's guide to AI features and your website says robots.txt rules for Googlebot are the control site owners use to manage access, so blocking Googlebot to stay out of AI Overviews would also remove the site from Search. Our guide to AIO, AEO and GEO covers what decides whether AI answers cite a page.