Skip to main content
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.
An XML sitemap tells search engines which pages a site has and when each one last changed. Crawlers find it through the 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

  1. Site root — takes scheme://host[:port] from the audited URL. A URL without a scheme or hostname ends the audit with 501.
  2. robots.txt — fetches <root>/robots.txt (as 37AuditsBot, with the site’s Basic Auth when configured) and reads only its Sitemap: lines, with crawler-commons’ robots parser: relative values are resolved against robots.txt, duplicates and empty lines are dropped. Allow/Disallow rules are not evaluated. The probe never calls ensureNotBlocked: a 403 or any other answer on robots.txt is recorded in issues, not treated as a blocked audit.
  3. Declared sitemaps — every Sitemap: URL is fetched and parsed, and its outcome is recorded in declaredSitemaps. The first one that parses is the audited sitemap.
  4. Fallbacks — when no declared sitemap parses (or none is declared), /sitemap.xml, /sitemap_index.xml and /sitemap/sitemap.xml under the site root are tried in turn, and the first that parses is audited (selectedFromFallback).
  5. 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.
  6. 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 in childSitemapsSkipped. Only one level is read: a child that is itself an index is reported as broken. Children not read within the budget are recorded in childSitemaps but not reported.
  7. 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.
  8. Sample — sampleSize URLs (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, and noindex in an X-Robots-Tag header or a robots/googlebot meta 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, 308 or 309 when it has a problem, 201 when it is healthy, 101 when it could not be checked.
  9. 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.
  10. Aggregate — FAIL wins over WARNING; a sitemap whose latest <lastmod> is within the window emits 200, and the audit is SUCCESS when no warning fired.
  11. 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 one checkRule* 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.txt is the one discovery mechanism every crawler shares; Search Console submissions only reach Google. Crawlers do not try /sitemap.xml on their own, which is why a broken Sitemap: line is a FAIL even when the fallback works.

Freshness window

  • The window is SITEMAP_MAX_AGE_DAYS (default 7 days). A brochure site that rarely changes will warn with 300 even 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.txt Allow/Disallow rules, including sitemap URLs that robots.txt blocks; those belong to a robots.txt auditor.
  • 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 403 cannot 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 of robots.txt is fetched, and the fallback paths are tried whenever none of them parses (they used to be tried only when robots.txt declared nothing). A site whose declared sitemap is broken but whose /sitemap.xml works moves from 400 to 402, with the fallback sitemap now audited. A broken line next to a working one warns with 303.
  • The children of a sitemap index are read: freshness comes from their URLs, so an index without <lastmod> can move from 301 to 200 or 300; broken children warn with 304.
  • New checks: 401 empty sitemap, 403 over the protocol limits, 305 URLs on another scheme or host, 306 future <lastmod>, and one check per sampled URL: 307/308/309 for problems, 201 when healthy, 101 when it could not be checked (new sampleSize preference, 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 in issues.
  • An invalid audited URL (no scheme or hostname) is now an ERROR with 37A-SitemapAuditor-501; it used to be a FAIL with 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.txt that answers HTTP 200 without a Sitemap: line now warns with 37A-SitemapAuditor-302, so a site whose sitemap was only found at a fallback path is a WARNING rather than a SUCCESS.
  • The available field is gone from the check data; selectedSitemapUrl is null when no sitemap parsed.