Sitemap lastmod: Record the Page Change, Not the Build Time
A sitemap can tell a crawler when a page last changed, but the date needs to describe that page. Rebuilding a sitemap on a schedule doesn't automatically make every listed page newly updated.
Separate the page from the sitemap file
In a sitemap's URL entry, lastmod describes the linked page's last modification. A sitemap index has a separate lastmod for the sitemap file it references. The Sitemaps protocol distinguishes the two and specifies a W3C date format.
Keep page change metadata alongside the content or in another source that survives a build. If an unchanged article is regenerated during a deployment, don't silently substitute the deployment time for its content change. If you can't establish a useful date, the protocol makes the field optional.
Choose a defensible update
Google says it uses lastmod when the value is consistently accurate and describes a meaningful page update in its sitemap documentation. For example, an article's corrected technical instructions can justify a new date; a routine site-wide footer change may not. Keep the underlying revision or editorial record so the value can be checked later.
Check the output before submitting it
Pick several recently edited and unchanged pages. Compare their sitemap URLs, canonical URLs and recorded dates to the source history. Ensure private or intentionally excluded pages aren't included. Parse the XML and check that dates are valid; an XML file that returns HTTP 200 can still contain wrong entries.
A sitemap is a discovery hint, not a guarantee of crawling, indexing or rank. Google's crawl troubleshooting guidance recommends examining actual crawl and indexing evidence instead of repeatedly submitting unchanged files.
Example: two page entries
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/guide/</loc>
<lastmod>2026-10-20</lastmod>
</url>
<url>
<loc>https://example.com/about/</loc>
</url>
</urlset>
The dates and URLs are illustrative. If the guideās last meaningful change was October 20, a November rebuild alone should not advance its date. Omitting lastmod for the second page is valid when its change date cannot be established. Parse the output and compare dates against the content history before submitting it.
If you need help planning an authorized automation workflow, ask for a scoped assessment. Share the documented limits and a redacted example, without credentials or private data.