You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(rules): report sitemap lastmod values that are not W3C Datetime #781
Found in review of #780 (#772). The sitemap protocol requires <lastmod> in W3C Datetime format (2024, 2024-09, 2024-09-10, or a datetime with a zone). No rule reports a lastmod in any other format:
2024-9 and 2024-09-31: these are now left out of all three, with no message saying why.
A datetime with no zone (2024-09-10T12:00:00), which the protocol does not allow.
Search engines may ignore a lastmod they cannot read, so a sitemap generator writing a non-W3C format is worth a finding. @squirrelscan/utils/date-period already exports w3cDatePeriod, which returns null for anything outside the W3C forms.
Acceptance Criteria
An audit of a sitemap whose lastmod values are outside the W3C Datetime format (for example 2024/09/10, 2024-9, Tue, 10 Sep 2024) reports them in a sitemap rule (for example crawl/sitemap-valid) with a sample of the values and their URLs.
A datetime with no zone is reported as missing its zone, not as unreadable.
W3C values (2024, 2024-09, 2024-09-10, 2024-09-10T12:00:00Z, 2024-09-10T12:00:00+02:00) are not reported.
The rule's docs page quotes the new message as a template.
Fixed in #892. crawl/sitemap-valid adds two warnings, each with a sample of URLs and lastmod "<value>" labels and the exact count. sitemap-lastmod-format (N sitemap lastmod value(s) are not in W3C Datetime format) covers values like 2024/09/10, 2024-9, 2024-09-31 and Tue, 10 Sep 2024. sitemap-lastmod-zone (N sitemap lastmod datetime(s) have no time zone) covers a datetime written without a zone. W3C values are not reported. The rule's docs page quotes both messages as templates. The tests are in packages/rules/tests/sitemap-lastmod-format-781.test.ts.
Activity
fix(sitemaps): report sitemaps that are not well-formed XML and lastm…
fix(sitemaps): report sitemaps that are not well-formed XML and lastm…
nc9 commentedon Oct 16, 2026
Fixed in #892.
crawl/sitemap-validadds two warnings, each with a sample of URLs andlastmod "<value>"labels and the exact count.sitemap-lastmod-format(N sitemap lastmod value(s) are not in W3C Datetime format) covers values like2024/09/10,2024-9,2024-09-31andTue, 10 Sep 2024.sitemap-lastmod-zone(N sitemap lastmod datetime(s) have no time zone) covers a datetime written without a zone. W3C values are not reported. The rule's docs page quotes both messages as templates. The tests are inpackages/rules/tests/sitemap-lastmod-format-781.test.ts.