How robots.txt rules are matched
Each crawler looks for the group of rules that names it most specifically. Googlebot-Image uses a User-agent: Googlebot-Image group if there is one, then Googlebot, then *. It only ever uses one group: if Googlebot has its own section, the * rules are ignored for it entirely.
Within that group, the longest matching rule wins, whether it's Allow or Disallow. If an Allow and a Disallow are the same length, Allow wins. * matches anything and $ marks the end of the URL, so Disallow: /*.pdf$ blocks PDFs but not /file.pdf?download=1.
And robots.txt controls crawling, not indexing. A blocked page can still show in Google if other sites link to it, just without a description. To keep a page out of search, allow crawling and add a noindex tag.
Blocking AI crawlers without losing search traffic
AI companies use separate crawlers for different jobs. Training crawlers like GPTBot, ClaudeBot, CCBot and the Google-Extended token collect pages to train models. Search and assistant crawlers like OAI-SearchBot, Claude-SearchBot and PerplexityBot fetch pages to answer questions and cite sources, which can send visitors your way.
The "Block AI training crawlers" button adds a group for the training crawlers only, so Google, Bing and AI search tools carry on as normal. Blocking Google-Extended does not affect Google Search rankings.
Questions agencies ask
Enter your domain above to fetch the live file, or paste it in. Then type any URL or path and the tester shows whether Googlebot, Bingbot and each AI crawler is allowed, and which line decided it. You can edit the file and test again before uploading it.
Yes. Google retired the old robots.txt Tester in Search Console in late 2023 and replaced it with a robots.txt report, which shows what Google fetched but does not let you test URLs or edits. This tester follows the same matching rules Google documents.
Add groups for the AI training crawlers, such as GPTBot, ClaudeBot, CCBot, Google-Extended and Applebot-Extended, with Disallow: /. The button in the tester does this for you. It doesn't affect Google Search, and you can still allow AI search crawlers that cite your pages.
No. Robots.txt stops crawling, not indexing. If other pages link to it, Google can still list the URL without a description. To remove a page from search, let Google crawl it and add a noindex meta tag or X-Robots-Tag header.
Because the file has a separate group for Googlebot. A crawler only follows the single most specific group that names it, so once Googlebot has its own section, the * rules don't apply to it. Copy any rules you need into the Googlebot group too.
If the file is missing (a 404 or other 4xx), crawlers assume everything is allowed. If the server returns a 5xx error, Google stops crawling the site until it can read the file, which is much worse. The tester shows the status of the live file.
Crawling problems on a client site?
When a site drops out of Google, it's often a robots.txt, noindex or redirect mistake left over from a launch. I find and fix that sort of thing for agencies, along with the WordPress, WooCommerce and Laravel issues behind it.
- White-label, under your brand, or alongside your team
- Laravel, WordPress, WooCommerce, integrations and tracking
- Inherited and half-finished sites taken over and stabilised
- UK based, straight to the developer, no account managers