SEO Auditor — locates the sitemap of the audited site (through
robots.txt or the usual paths), reads it and the child sitemaps of an index, checks that its latest <lastmod> is recent, and fetches a sample of the URLs it lists.Discovery
Reads
Sitemap: lines in robots.txt and fetches each one; when none works, tries /sitemap.xml, /sitemap_index.xml and /sitemap/sitemap.xml.Standards
Follows the Sitemaps XML format, protocol version 0.9, published at sitemaps.org.
Sitemap: line of robots.txt or at a well-known path, and use its <lastmod> dates to decide what to recrawl. A missing sitemap leaves discovery to link following; a sitemap whose dates stopped moving tells crawlers nothing new is there. Search engines do not guess sitemap paths: they read the Sitemap: lines of robots.txt and the sitemaps submitted in their consoles, so a broken declaration hides even a working sitemap. This auditor never fetches the audited page itself: it reads robots.txt, the sitemaps and a sample of the listed URLs.
How it works
- Site root — takes
scheme://host[:port]from the audited URL. A URL without a scheme or hostname ends the audit with501. - robots.txt — fetches
<root>/robots.txt(as 37AuditsBot, with the site’s Basic Auth when configured) and reads only itsSitemap:lines, with crawler-commons’ robots parser: relative values are resolved againstrobots.txt, duplicates and empty lines are dropped.Allow/Disallowrules are not evaluated. The probe never callsensureNotBlocked: a 403 or any other answer onrobots.txtis recorded inissues, not treated as a blocked audit. - Declared sitemaps — every
Sitemap:URL is fetched and parsed, and its outcome is recorded indeclaredSitemaps. The first one that parses is the audited sitemap. - Fallbacks — when no declared sitemap parses (or none is declared),
/sitemap.xml,/sitemap_index.xmland/sitemap/sitemap.xmlunder the site root are tried in turn, and the first that parses is audited (selectedFromFallback). - Parse — every sitemap is fetched through the auditor’s HTTP client (redirects followed, bodies up to 50 MB, 30 s per request, gzip detected by magic bytes even without
Content-Encoding) and parsed by crawler-commons 1.6, which detects the format from the bytes: XML<urlset>and<sitemapindex>, RSS, Atom and plain-text URL lists all count. An HTML page, an unknown XML root or a non-2xx answer is a broken candidate. - Index children — when the audited sitemap is a
<sitemapindex>, its first 50 children are fetched and parsed in parallel (8 at a time, 45 s in all); the rest are counted inchildSitemapsSkipped. Only one level is read: a child that is itself an index is reported as broken. Children not read within the budget are recorded inchildSitemapsbut not reported. - Listed URLs — across the sitemap and its children, the auditor counts the URLs, keeps the latest
<lastmod>, counts<lastmod>values more than one day in the future (and leaves them out of freshness), and counts URLs whose scheme or host differs from the audited sitemap’s final URL. - Sample —
sampleSizeURLs (default 20) are picked by the smallest CRC32 of their URL, so the sample is spread over the sitemap and identical from run to run. Each is fetched with a GET in parallel (8 at a time, 30 s in all, 5 MB per body): an HTTP 4xx/5xx final answer, a redirect, andnoindexin anX-Robots-Tagheader or arobots/googlebotmeta tag are reported. HTTP 403, 429, a Cloudflare challenge or a bot wall leaves the URL unchecked. Every sampled URL becomes a check of its own:307,308or309when it has a problem,201when it is healthy,101when it could not be checked. - Freshness window —
SITEMAP_MAX_AGE_DAYS(Lambda environment, default 7 days). Date-only<lastmod>values are read as the start of that day in UTC. - Aggregate — FAIL wins over WARNING; a sitemap whose latest
<lastmod>is within the window emits200, and the audit isSUCCESSwhen no warning fired. - Specification pin — every run emits
37A-SitemapAuditor-100(INFORMATION), naming the Sitemaps XML format, protocol version 0.9. It does not change the overall status.
Preferences
A missing, negative, fractional or non-numeric value falls back to
20.
What it audits
Every row maps to onecheckRule* method and one CheckCode, in the order the auditor runs them. CheckCode suffixes use status ranges: 100 information, 200 success, 300–399 warning, 400–499 fail, 500–599 error.
Output documentation
The site-level checks (
400, 402, 401, 403, 303, 300–306, 200) carry the same data map: siteBase, robotsTxtUrl, robotsTxtHttpStatus, robotsTxtListsSitemap, declaredSitemaps (url, ok, outcome per Sitemap: line), candidateSitemaps, selectedSitemapUrl, selectedFromFallback, sitemapType (urlset, sitemapindex, rss, atom or text), sitemapHttpStatus, contentType, entryCount (URLs, or <sitemap> entries of an index), childSitemaps (url, httpStatus, urlCount, error), childSitemapsSkipped, totalUrlCount, latestLastmod (ISO instant or null), futureLastmodCount, outOfScopeUrlCount, sampleSize, maxAgeDays and issues. The per-URL checks (101, 201, 307–309) carry only that URL: url, httpStatus, finalUrl, noindex (where it was found, or null), unchecked (why it was not checked, or null) and selectedSitemapUrl.
Risks and considerations
Why the sitemap matters
- Search engines discover and prioritise pages from the sitemap; a site without one relies on internal links alone, and pages far from the home page may never be crawled.
<lastmod>is the signal crawlers use to recrawl changed pages first. Dates that never move, are missing or point to the future make every page look equally stale.- Listing the sitemap in
robots.txtis the one discovery mechanism every crawler shares; Search Console submissions only reach Google. Crawlers do not try/sitemap.xmlon their own, which is why a brokenSitemap:line is aFAILeven when the fallback works.
Freshness window
- The window is
SITEMAP_MAX_AGE_DAYS(default 7 days). A brochure site that rarely changes will warn with300even though nothing is wrong with its sitemap; the warning is a prompt to keep<lastmod>honest, not a defect of the site. - For an index, freshness comes from the
<lastmod>of the index entries and of every URL in the children read, so an index without dates (like WordPress’wp-sitemap.xml) is judged by its posts.
What this auditor does not check
robots.txtAllow/Disallowrules, including sitemap URLs thatrobots.txtblocks; those belong to arobots.txtauditor.- Children of an index past the first 50, and indexes nested deeper than one level.
- Listed URLs outside the sample: a broken URL is only found when it is sampled. Raise
sampleSize(up to 100) for a wider net. - Canonical tags, hreflang, image and video extensions,
<priority>and<changefreq>. - A plain-text sitemap over 50,000 lines: crawler-commons stops reading it there, so
403cannot fire for text files.
Changes from the previous version
- Sitemaps are parsed by crawler-commons: RSS, Atom and plain-text sitemaps are now evaluated instead of failing with an unknown root element.
-
Every
Sitemap:line ofrobots.txtis fetched, and the fallback paths are tried whenever none of them parses (they used to be tried only whenrobots.txtdeclared nothing). A site whose declared sitemap is broken but whose/sitemap.xmlworks moves from400to402, with the fallback sitemap now audited. A broken line next to a working one warns with303. -
The children of a sitemap index are read: freshness comes from their URLs, so an index without
<lastmod>can move from301to200or300; broken children warn with304. -
New checks:
401empty sitemap,403over the protocol limits,305URLs on another scheme or host,306future<lastmod>, and one check per sampled URL:307/308/309for problems,201when healthy,101when it could not be checked (newsampleSizepreference, default 20). -
Date-only
<lastmod>values are read as the start of that day in UTC (they used to be the end of the day), and unparsable values are no longer listed inissues. -
An invalid audited URL (no scheme or hostname) is now an
ERRORwith37A-SitemapAuditor-501; it used to be aFAILwith no check. -
A sitemap without any parsable
<lastmod>now gets its own warning,37A-SitemapAuditor-301; it used to be reported as “out of date” together with the stale case. -
A
robots.txtthat answers HTTP 200 without aSitemap:line now warns with37A-SitemapAuditor-302, so a site whose sitemap was only found at a fallback path is aWARNINGrather than aSUCCESS. -
The
availablefield is gone from the check data;selectedSitemapUrlisnullwhen no sitemap parsed.