robots.txt patterns that survive Google's parser

Google's parser supports four fields and ignores the rest. Write for the parser you have, not the one you remember from 2009.

What Google actually reads

Google supports user-agent, allow, disallow, and sitemap. Everything else in the file is inert for Googlebot. In particular:

  • crawl-delay is not supported. Google retired all code handling unsupported rules on September 1, 2019. Writing crawl-delay does not throttle Googlebot.
  • noindex in robots.txt never worked. It was never part of the standard. Use a meta robots tag or an X-Robots-Tag header instead.

How matching works

  • Longest match wins. When an allow and a disallow both match, the more specific (longer) path rule applies — not whichever appears first.
  • Paths are case-sensitive. Disallow: /Admin/ does not block /admin/.
  • A path is a prefix. Disallow: /admin also blocks /administrator; use Disallow: /admin/ for the directory only.
  • Wildcards: * matches any sequence, $ anchors the end — e.g. Disallow: /*.pdf$ blocks PDF URLs.

Disallow is not an indexing control

robots.txt controls crawling, not indexing. Google may still index a disallowed URL — without its content — if it is referenced elsewhere. If a page must not appear in Search, keep it out with noindex or authentication; if it must not be crawled, disallow it. Do not confuse the two jobs.

The classic failure. A staging site ships with Disallow: /, the rule is copied to production, and every page drops out of the crawl. Audit for a leftover site-wide disallow after every migration.

Do not block what Google needs to render

Disallowing .js, .css, or asset directories can prevent Google from rendering pages correctly, which degrades how the content is understood. Block the pages you do not want crawled; leave the resources those pages need alone.

Operational notes

  • Size limit: Google stops processing a robots.txt larger than 500 KiB.
  • Caching: Google caches the file for up to 24 hours, so changes are not immediate.
  • Sitemap line: include an absolute sitemap URL — Sitemap: https://example.com/sitemap.xml — so discovery does not depend on Search Console alone.
  • Faceted navigation: blocking /*? blocks every parameterized URL, including pagination you may want crawled. Be specific about which parameters are crawl waste.

A minimal, honest template

User-agent: *
Disallow: /admin/
Disallow: /api/
Disallow: /*?sort=
Disallow: /*&filter=

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

Start from this shape and add rules only for demonstrated crawl waste — never preemptively for URL patterns you merely dislike.

pSEO Tech · Published . Prepared with AI assistance; editorial approach and corrections are described on our method page. Examples are illustrative, not case-study results.

References and further reading