How crawlers read robots.txt
robots.txt sits at the root of a host (https://example.com/robots.txt) and applies only to that host and protocol. Since RFC 9309 (2022) the rules are standard:
- A crawler picks the group whose User-agent most specifically matches its name, or the
*group if none does. Groups do not combine: if aGooglebotgroup exists, Googlebot ignores*. - Within the group, the longest matching Allow or Disallow rule wins. If an Allow and a Disallow match with the same length, Allow wins.
*matches any characters and$anchors the end of the URL. Paths are case-sensitive.
An empty Disallow: allows everything. A 404 robots.txt means everything may be crawled; a 5xx makes Google stop crawling until the file is reachable.
Blocking is not de-indexing
Disallow stops crawling, not indexing. A blocked page can still appear in search results (without a snippet) if other sites link to it. To keep a page out of results, allow crawling and add noindex with a meta robots tag or an X-Robots-Tag header; check it with the meta tag checker.
Never block CSS and JavaScript that pages need: Google renders pages, and blocked resources can make them look broken to it.
AI crawlers
Many sites now decide separately about AI crawlers. Common tokens are GPTBot (OpenAI), ClaudeBot (Anthropic), Google-Extended (Gemini training, not Google Search), CCBot (Common Crawl) and Applebot-Extended. Blocking Google-Extended does not affect ranking in Google Search. The tester checks all of them against the same path at once.