Skip to content

feat(rules): report sitemap lastmod values that are not W3C Datetime #781

Closed

Description

@nc9

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:

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.

Activity

  1. added
    enhancement
    size: S
    rules
    on Oct 14, 2026
  2. nc9 commented on Oct 16, 2026

    @nc9
    ContributorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementrulessize: S

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions