What robots.txt does and does not control
robots.txt tells crawlers which paths they may request. It does not remove pages from the index; a page blocked by robots.txt can still be indexed from links and shown with no snippet. To keep a page out of results, use a noindex meta tag or X-Robots-Tag header and let it be crawled. To stop crawlers hitting expensive endpoints such as /api/ or faceted search, robots.txt is the right tool.
It is also advisory. Well-behaved crawlers from Google, Bing, and the main AI companies obey it; scrapers do not. Treat it as crawl management, not security.
Step one: confirm the file is reachable and served correctly
Request https://yourdomain.com/robots.txt directly. It must return HTTP 200 with a text/plain content type and be under 500 KiB, which is Google's parsing limit. A 404 is treated as "allow everything"; a 5xx or timeout makes Google treat the site as fully disallowed until the file recovers, which is the single most damaging robots.txt failure. Check that the www and non-www hosts and the http and https schemes all serve the same file, since each host-scheme pair is a separate robots.txt in the protocol.
Step two: validate the syntax and structure
The file is groups of lines. Each group starts with one or more User-agent lines followed by Allow and Disallow rules, and Sitemap lines can appear anywhere. Common syntax faults are a rule before any User-agent line, a Disallow with no path (which allows everything), Windows line endings mixed with Unix, and a byte-order mark at the start of the file that makes the first line unparseable. Comments start with #. Paths are case-sensitive and must start with /.
| Directive | Meaning | Notes |
|---|---|---|
| User-agent: * | Rules for all crawlers not matched by a more specific group | A crawler uses only the most specific matching group |
| Disallow: /path | Do not crawl URLs starting with /path | Empty Disallow allows everything |
| Allow: /path/file | Crawl this even if a Disallow matches | Longest match wins; Allow wins ties in Google |
| Wildcards * and $ | * matches any sequence, $ anchors the end | Supported by Google and Bing; not in the original standard |
| Sitemap: https://... | Absolute URL of a sitemap | Can appear multiple times, anywhere in the file |
| Crawl-delay | Seconds between requests | Ignored by Google; honoured by Bing |
Step three: test specific URLs against specific user agents
Syntax can be valid and still wrong. Pick ten URLs that must be crawlable, including your homepage, a product or article page, your sitemap, and your CSS and JS asset paths, plus five URLs that must be blocked. Test each against Googlebot, Bingbot, and the AI agents using a tester that implements the longest-match rule. SerionFlow's free robots.txt checker fetches the live file, parses it, and reports allow or block per URL and user agent; Google Search Console's robots.txt report shows the version Google last fetched and any parse errors.
Blocking CSS or JavaScript paths is a frequent silent failure: the page is crawlable but Google cannot render it, and rendering-dependent content is lost.
Step four: check the AI crawler groups
GPTBot (OpenAI), ClaudeBot (Anthropic), PerplexityBot, Google-Extended (Google's AI training control), and CCBot (Common Crawl) each honour their own User-agent group. A blanket Disallow for these ends any chance of citation in the corresponding assistants, which may or may not be what you intend. Decide deliberately, write explicit groups, and test them. Note that Google-Extended controls training use of your content, not Googlebot crawling, so blocking it does not remove you from AI Overviews. Some CDNs, including Cloudflare, can block AI crawlers at the edge regardless of robots.txt, so check that layer too.
- Write explicit User-agent groups for each AI crawler you want to allow or block.
- Test them with the same URL list you used for Googlebot.
- Check CDN bot settings; edge blocks override robots.txt.
Mistakes that show up most often
Disallow: / left over from staging. A Sitemap line pointing at a relative path or a 404. Blocking /wp-content/ or /assets/ and starving the renderer. Using Disallow to hide pages that are already indexed, which freezes their stale snippet in place. Expecting robots.txt to apply across subdomains; each host needs its own file. And deploying a new file without re-testing, because the previous one was fine.
Step by step
- 01
Fetch the file
Request /robots.txt on every host and scheme you serve and confirm a 200 response with a text content type and no byte-order mark.
- 02
Validate syntax
Check that every rule sits under a User-agent line, paths start with a slash, wildcards are intentional, and Sitemap URLs are absolute and resolve.
- 03
Build a URL test list
Choose ten URLs that must be crawlable, including asset paths, and five that must be blocked, so the test covers both directions.
- 04
Test per user agent
Run the list against Googlebot, Bingbot, GPTBot, ClaudeBot, PerplexityBot, and Google-Extended with a tester that applies longest-match rules.
- 05
Check the CDN layer
Confirm that bot management or AI crawler blocking at the CDN is not overriding what robots.txt allows.
- 06
Retest after every deploy
Add the test to your release checklist and monitor the file for changes, since a single bad line can disallow the whole site.
Clear answers
Frequently asked questions
How do I test robots.txt online for free?
+
Use a tester that fetches your live file and evaluates a URL against a user agent. SerionFlow's free robots.txt checker does this without an account and reports allow or block per rule. Google Search Console's robots.txt report shows what Google last fetched and any parse errors it found.
Does robots.txt stop a page from being indexed?
+
No. It stops crawling, not indexing. A blocked URL can still be indexed from links and shown without a snippet. To keep a page out of search results, allow crawling and add a noindex meta tag or X-Robots-Tag header instead.
What happens if robots.txt returns a server error?
+
Google treats a 5xx or a timeout on robots.txt as a full disallow for the site until the file is reachable again, so crawling stops. A 404 is treated as allowing everything. Monitoring the file's availability is therefore as important as its contents.
Which rule wins when Allow and Disallow both match?
+
The rule with the longest matching path wins. If the lengths are equal, Google applies the Allow. Bing follows a similar longest-match approach. Testers that implement this correctly will show the winning rule for each URL.
Should I block AI crawlers in robots.txt?
+
Only if you have decided you do not want your content retrieved or cited by those assistants. Blocking GPTBot, ClaudeBot, or PerplexityBot ends citation in the corresponding products. Google-Extended controls AI training use and does not affect Googlebot or AI Overviews.
Continue exploring
Related SerionFlow resources
More in Guides
- Meta description length and best practices
- Programmatic SEO on Next.js and Vercel
- Programmatic SEO on Shopify: what works and what does not
- Programmatic SEO on Webflow: how to set it up and where it stops
- Programmatic SEO on WordPress: how to set it up and what to watch
- robots.txt for AI crawlers: how to allow or block GPTBot, ClaudeBot, and others
- robots.txt monitoring: how to detect changes and outages
- Title tag length and best practices
Make the next move obvious
Let SerionFlow turn your market evidence into momentum.
Confirm the market, rank the opportunities that matter, create brand matched pages on your domain, and keep moving with controlled weekly intelligence.