SEO Auditor — locates the XML sitemap of the audited site (through
robots.txt or the usual paths), parses it and checks that its latest <lastmod> is recent.Discovery
Reads
Sitemap: lines in robots.txt, then 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. This auditor never fetches the audited page itself: it only reads robots.txt and the candidate sitemaps.
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 collects everySitemap:line. The probe never callsensureNotBlocked: a 403 or any other answer onrobots.txtis recorded inissues, not treated as a blocked audit. - Candidates — the
robots.txtURLs, or when there are none,/sitemap.xml,/sitemap_index.xmland/sitemap/sitemap.xmlunder the site root. - Parse — fetches each candidate in turn (redirects followed, bodies up to 50 MB, 30 s per request, gzip detected by magic bytes even without
Content-Encoding) until one answers HTTP 2xx with a<urlset>or<sitemapindex>root. Child sitemaps of an index are not fetched. The entries’<lastmod>values are parsed (W3C Datetime with or without time zone, date-only read as end of that day) and the latest one is kept; values that do not parse are listed inissues. - Rules — no candidate parsed fails (
400). On the parsed sitemap, a latest<lastmod>older than the freshness window warns (300), and no parsable<lastmod>at all warns (301). Independently, arobots.txtthat answered HTTP 200 without aSitemap:line warns (302), even when a fallback path yielded a sitemap. - Freshness window —
SITEMAP_MAX_AGE_DAYS(Lambda environment, default 7 days). - 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.
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
Every check carries the same
data map: siteBase, robotsTxtUrl, robotsTxtHttpStatus, robotsTxtListsSitemap, candidateSitemaps, selectedSitemapUrl, sitemapType (urlset or sitemapindex), sitemapHttpStatus, contentType, entryCount, latestLastmod (ISO instant or null), maxAgeDays and issues.
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, or are missing, 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.
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. - Date-only
<lastmod>values (2026-10-16) are read as the end of that day in UTC, so a sitemap updated today is always inside the window.
What this auditor does not check
- Only the first sitemap that parses is examined. Child sitemaps of a
<sitemapindex>are not fetched, so their own<lastmod>values and URL counts are not seen. - The URLs listed in the sitemap are not fetched or validated, and the 50,000-URL and 50 MB limits of the protocol are not enforced.
- Sitemaps in other formats (RSS, Atom, plain-text URL lists) are reported as an unknown root element and do not count.
- A
robots.txtthat is missing (404) or blocked (403) is not a finding by itself; the auditor just falls back to the usual paths.
Changes from the previous version
- 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.