seo-crawl-control-pitfalls
Step 6 of the pipeline (WORKFLOW.md), for the file that decides what a crawler may fetch. seo §1.3 says that
robots.txt must match the real intent; this block says how one such file is actually read, because the usual
errors are not typos but wrong beliefs about precedence. The two sections share one premise: a robots.txt is
read by a matcher with fixed rules, and the only way to know what a file does is to ask that matcher about real
URLs. The rules below were read from the source of Google's open-source matcher (robots.cc and robots.h),
so they describe that parser; another crawler can differ, and each statement says where it comes from. The sitemap at page level is seo §4 and the crawl health of a built site is seo §5; this block does not restate them.
When
- Writing or editing a
robots.txt, or a block in it for one crawler.
- A page that should be crawled is not, or the reverse, and the file looks right.
- Adding a sitemap, or a site grows past one sitemap file.
- Reviewing a
Disallow that was written to protect something.
Steps
Read only the section the task meets. They are independent.
| § |
Covers |
Read it when |
File |
| 1 |
Reading the file: precedence, groups, crawler tokens, patterns, case, encoding, index shortcut, tolerance |
a rule is written or a result is surprising |
01-robots-matching.md |
| 2 |
Testing and sitemaps: the reference matcher, what it does not model, sitemap limits |
a file is about to be shipped, or a sitemap is added |
02-testing-and-sitemaps.md |
Output / checkpoint
Each rule was exercised, not read off the file: the file was run through the reference matcher with a list of URLs
that must be allowed and a list that must be blocked, for each crawler named in it, including one URL with a
query string, one with different letter case and one directory index (§1, §2). A robots.txt that was only read
by eye is not verified, and a rule copied from this block was not verified until the matcher agreed with it.
Guardrails
- Never assume the first matching rule or the order of the lines decides; the longest matching pattern does (§1.1).
- Never add a group for one crawler without repeating the rules of the star group that it still needs (§1.2).
- Never write a path in a different letter case from the URL it is meant to block (§1.3).
- Never rely on a tolerated typo, a byte order mark or an over-long line; other crawlers may not be as forgiving
(§1.4).
- Never put a URL on a blocklist for security: a robots.txt asks crawlers to stay away and protects nothing; the
standard says it is not access authorisation and that listing a path exposes it (RFC 9309 sections 1 and 3, and 2.1).
- Never block with
Disallow a page that must carry noindex: the crawler cannot fetch the page, so it never sees
the tag (Google's block-indexing page; §2.1.5).
- This block states the behaviour of the matcher at the commit named in
references/origin.md, read in source and not run, and cross-checks the points that
matter with RFC 9309 and Google's published documentation.
Origin
Rewritten from reading robots.cc, robots.h and the README of google/robotstxt (Apache-2.0) and, for the
sitemap limits only, a short list of sitemap practices in the Web Quality Skills seo skill (MIT), read 2026-10-16, then cross-checked on 2026-10-20 against RFC 9309 and Google Search Central's robots.txt,
block-indexing and sitemap pages (facts only, rewritten). 🟡: never run by us; open points are in references/origin.md.
1---2name: seo-crawl-control-pitfalls3description: "Use when a robots.txt or a sitemap is written, changed or debugged: which rule wins (longest pattern, rule order irrelevant), a crawler-specific group replacing the star group, where groups start and end, crawler token matching, wildcards and the end anchor, case-sensitive paths, percent-encoding, the index file shortcut of Allow, tolerated typos, a byte order mark and long lines, testing a file against real URLs with Google's reference matcher, and sitemap size limits. Page-level meta, structured data and the audit of a built site are seo."4metadata:5 source: https://skillmd.com/skills/techmefr/seo-crawl-control-pitfalls6---78# seo-crawl-control-pitfalls910Step 6 of the pipeline (`WORKFLOW.md`), for the file that decides what a crawler may fetch. `seo` §1.3 says that11`robots.txt` must match the real intent; this block says how one such file is actually read, because the usual12errors are not typos but wrong beliefs about precedence. The two sections share one premise: **a robots.txt is13read by a matcher with fixed rules, and the only way to know what a file does is to ask that matcher about real14URLs**. The rules below were read from the source of Google's open-source matcher (`robots.cc` and `robots.h`),15so they describe that parser; another crawler can differ, and each statement says where it comes from. The sitemap at page level is `seo` §4 and the crawl health of a built site is `seo` §5; this block does not restate them.1617## When18- Writing or editing a `robots.txt`, or a block in it for one crawler.19- A page that should be crawled is not, or the reverse, and the file looks right.20- Adding a sitemap, or a site grows past one sitemap file.21- Reviewing a `Disallow` that was written to protect something.2223## Steps2425**Read only the section the task meets.** They are independent.2627| § | Covers | Read it when | File |28|---|---|---|---|29| 1 | Reading the file: precedence, groups, crawler tokens, patterns, case, encoding, index shortcut, tolerance | a rule is written or a result is surprising | [`01-robots-matching.md`](./references/01-robots-matching.md) |30| 2 | Testing and sitemaps: the reference matcher, what it does not model, sitemap limits | a file is about to be shipped, or a sitemap is added | [`02-testing-and-sitemaps.md`](./references/02-testing-and-sitemaps.md) |3132## Output / checkpoint33Each rule was exercised, not read off the file: the file was run through the reference matcher with a list of URLs34that must be allowed and a list that must be blocked, for each crawler named in it, including one URL with a35query string, one with different letter case and one directory index (§1, §2). A robots.txt that was only read36by eye is not verified, and a rule copied from this block was not verified until the matcher agreed with it.3738## Guardrails39- Never assume the first matching rule or the order of the lines decides; the longest matching pattern does (§1.1).40- Never add a group for one crawler without repeating the rules of the star group that it still needs (§1.2).41- Never write a path in a different letter case from the URL it is meant to block (§1.3).42- Never rely on a tolerated typo, a byte order mark or an over-long line; other crawlers may not be as forgiving43 (§1.4).44- Never put a URL on a blocklist for security: a robots.txt asks crawlers to stay away and protects nothing; the45 standard says it is not access authorisation and that listing a path exposes it (RFC 9309 sections 1 and 3, and 2.1).46- Never block with `Disallow` a page that must carry `noindex`: the crawler cannot fetch the page, so it never sees47 the tag (Google's block-indexing page; §2.1.5).48- This block states the behaviour of the matcher at the commit named in49 [`references/origin.md`](./references/origin.md), read in source and not run, and cross-checks the points that50 matter with RFC 9309 and Google's published documentation.5152## Origin53Rewritten from reading `robots.cc`, `robots.h` and the README of google/robotstxt (Apache-2.0) and, for the54sitemap limits only, a short list of sitemap practices in the Web Quality Skills `seo` skill (MIT), read 2026-10-16, then cross-checked on 2026-10-20 against RFC 9309 and Google Search Central's robots.txt,55block-indexing and sitemap pages (facts only, rewritten). 🟡: never run by us; open points are in [`references/origin.md`](./references/origin.md).