Guides

robots.txt checklist

A practical robots.txt checklist based on Google's robots.txt spec: location, syntax, rule precedence, status-code handling, and mistakes that block the wrong URLs.

robots.txt is a small file with outsized consequences: one wrong line can hide an entire site from crawlers, and a missing line can let crawlers waste time in crawl traps. Use this checklist when creating a file, reviewing a site, or before a launch. Every point below reflects how Google documents its own handling of robots.txt.

1. Location and scope

2. HTTP status and availability

How the file is served matters as much as what it says:

ResponseHow Google treats it
2xxProcesses the file as served.
3xxFollows at least five redirect hops, then treats it as a 404.
4xx (except 429)As if no robots.txt exists — no crawl restrictions at all.
5xx, 429, timeouts, DNS errorsTreated as a server error. For the first 12 hours Google stops crawling the site while retrying; then for up to 30 days it uses the last good cached copy. After that it depends on whether the rest of the site is available.

Checklist items: the file returns 200 quickly; it doesn't redirect through a long chain; it isn't accidentally returning 5xx behind a CDN or firewall rule; and a 401/403 isn't being used as a way to slow crawlers (Google says 4xx codes other than 429 have no effect on crawl rate).

Google generally caches robots.txt for up to 24 hours, so changes are not instant.

3. Format

4. Only use fields Google supports

Google supports user-agent, allow, disallow and sitemap. Other fields are ignored, including:

5. User-agent groups

6. Rule matching and precedence

Example: block internal search and sort parameters, but keep everything else open.

User-agent: *
Disallow: /search
Disallow: /*?*sort=
Disallow: /*?*sessionid=

Sitemap: https://www.example.com/sitemap.xml

7. Don't block what Google needs

8. Sitemap lines

More on what goes inside those files in XML sitemap best practices.

9. Test before and after deploying

Check your own site

The free Crawl Budget Snapshot fetches a site's public robots.txt and sitemaps and gives a quick crawl-waste score with suggested fixes. It is a starting point, not a replacement for Search Console or log analysis.

References

More guides