Sitemap lastmod: Accurate Page and Index Timestamps
A precise lastmod implementation guide for content, ecommerce, and programmatic pages—without fake freshness signals.
Key takeaways
- lastmod should represent a meaningful change to the indexed page.
- Code deployments, analytics events, and unrelated database writes are not content updates.
- Use one canonical timestamp source per content type.
- Omit lastmod when the source cannot be trusted.
What lastmod communicates
The lastmod element tells a crawler when the page content last changed in a meaningful way. Search engines may use a consistently accurate value when deciding what to recrawl. It is not an instruction and it does not make a page look fresh simply because the date is recent.
Changes that should update the date
Update lastmod when the primary content, structured facts, availability, pricing, documentation, or other information visible to search users changes materially. The exact rule depends on the page type, but it should always map to a user-visible reason to revisit the URL.
- An article receives a substantive correction or new section
- A product's price, availability, or specification changes
- API documentation changes an endpoint or response contract
- A directory profile receives newly collected source data
Changes that should not update the date
Do not update every URL after a deployment, cache purge, analytics event, view count, background job, or unrelated record change. Those events create uniform timestamps that say nothing about individual page freshness.
Choose a trustworthy source
For CMS pages, use a timestamp advanced by significant published changes. A review that changes nothing is not a modification; a review timestamp must not override a later substantive edit. For ecommerce, derive a timestamp from meaningful visible facts. For data-driven profiles, use when materially different data was published, not every successful collection time: identical fetched data does not modify a page.
Persist the source timestamp and serialize a W3C date or datetime. UTC is convenient, but explicit timezone offsets are valid. Use YYYY-MM-DD when that is the precision you know; do not invent a time of day. Omit lastmod if no reliable source exists for that page.
<url>
<loc>https://example.com/docs/sitemap-api</loc>
<lastmod>2026-07-18T08:30:00Z</lastmod>
</url>Separate publication, page modification, and file modification
Publication records when a page first became public. Page lastmod records its latest significant change. Index lastmod records when the referenced sitemap file changed, not when an arbitrary page inside it changed. An HTTP Last-Modified header is a separate signal; the protocol does not require crawlers to interpret it identically to XML lastmod.
Google names primary text, structured data, and links as examples of significant updates. Apply that to the page's substance: changing relevant facts or links can matter, while a sidebar punctuation edit, copyright year, or view-count increment normally should not advance every page date.
<!-- Page-level fragment: the article changed September 28. -->
<url>
<loc>https://example.com/articles/sitemap-maintenance</loc>
<lastmod>2026-09-28</lastmod>
</url>
<!-- Index-level fragment: its child file changed October 1. -->
<sitemap>
<loc>https://example.com/sitemaps/articles.xml</loc>
<lastmod>2026-10-01T09:15:00Z</lastmod>
</sitemap>These fragments belong to different parent documents, not one complete sitemap. Date-only and timezone-qualified timestamps are valid; locale dates such as 01/10/2026 are not.
Derive dates from content changes, not background activity
Define significant fields for each template and persist contentModifiedAt when a published change affects them. An article might track its body, cited facts, and relevant structured data; a product might track price, availability, and specifications. Keep this separate from record updatedAt fields advanced by synchronization, review queues, or analytics writes.
For an aggregate homepage or category, record when displayed inventory or primary content materially changes. Do not take the maximum updatedAt across all related rows regardless of whether they appear on the page. If you cannot determine an honest value for those aggregates, omit it there while retaining reliable dates for other URLs.
Run controlled stability checks
Save a sitemap snapshot and source dates before an ordinary deployment. Regenerate without content edits and compare: unchanged pages should not advance. Publish a meaningful edit to one page, then verify that its date advances while unrelated entries remain stable. Check the child's index-level file date separately.
Checker reports coverage, oldest and newest valid dates, and future-date counts; these cannot prove correspondence with real edits. Compare a sample from each template with publishing records. A calendar-valid future date can be reported without invalidating the document structurally. Check timezone and scheduled-publication handling before assuming deliberate freshness manipulation.
- Dates change on every fetch: replace request-time now() with a persisted content timestamp.
- Every page changes after deploy: remove build time from the page-level generator.
- A review date hides a later edit: derive lastmod from the latest significant published change, not the review log.
- Real edits leave dates unchanged: check the publishing transaction and sitemap cache invalidation.
Audit lastmod quality
Sample URLs from every sitemap type and compare the XML value with the page's visible update date and source record. Look for impossible future dates, every URL changing together, dates older than the content, and values that change on every request.
If you cannot produce a stable, verifiable value, omit lastmod while you fix the source. Absence creates less noise than a timestamp that routinely misrepresents the page.
Extract URLs and their available lastmod values.
Open the free toolFrequently asked questions
Does a recent lastmod improve ranking?
No. It can help recrawl decisions when accurate, but it does not replace relevance or content quality.
Should a deployment update every lastmod value?
Only if the deployment materially changed every page's user-visible content, which is uncommon. Use page-level content timestamps instead.
Is a date without a time valid?
Yes. ISO 8601 dates such as 2026-07-18 are valid when day-level precision matches the source data.
Primary references
- Google Search Central: Sitemap lastmod guidance
- Google Search Central: Significant modifications and ping deprecation
- Sitemaps.org protocol
Technical content: SitemapKit Engineering. Maintained by Clément Chaal.
See our technical methodology and editorial policy.