Skip to main content

Search 400 pages — tools, formats, elements, namespaces, directory, comparisons, XPath, datatypes, glossary, parse errors, schema errors, use cases, guides, blog and product.

Sitemaps guide

How to use sitemap lastmod correctly

What <lastmod> should measure, which date forms are valid, when to omit it, and why stamping every URL on every deploy destroys the signal.

6 min read · Updated 2026-08-21

The short answer

Set <lastmod> to the time of the page's last significant content change. Use a W3C date or date-time, keep it consistent with the page, and omit it when you cannot calculate it honestly. Do not replace every value with the build or crawl time.

Measure the page, not the sitemap file

The value describes the referenced page. Regenerating sitemap.xml, changing its whitespace, or deploying unrelated code does not make every page new.

A significant change includes the main content, structured data, or important links. A rotating footer date or analytics script normally is not a reason to advance lastmod.

Choose a valid precision

A date is enough when your source data only knows the day. Use a date-time when the hour matters, and include Z or an explicit offset. More precision is not more accurate when it was invented by the build.

Valid date and date-time forms
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/handbook</loc>
    <lastmod>2026-08-20</lastmod>
  </url>
  <url>
    <loc>https://example.com/releases/42</loc>
    <lastmod>2026-08-20T14:35:00+02:00</lastmod>
  </url>
</urlset>

Make freshness falsifiable

Derive lastmod from a durable content field, not the current clock. Then compare a sample of sitemap values with the pages or records that produced them. If every URL has the same timestamp, the implementation is probably reporting the build rather than the content.

  • Store a meaningful updated_at alongside the page record.
  • Advance it only for changes users or search engines can observe.
  • Serialize it with an explicit timezone when using a date-time.
  • Omit lastmod for records whose modification time is unknown.

Get started

Bring order to the XML your team can't afford to ignore.

Create a free account and get a private workspace to search, validate, diff, and monitor your XML feeds, sitemaps, schemas, and vendor integrations.