<lastmod> inside <url>
- Describes
- The date the linked page was last modified
- Does not describe
- When the sitemap file was generated
lastmod is the sitemap tag for a page's last modified date. The W3C Datetime format, what counts as a real change, the sitemap index meaning and how to audit it.
lastmod is an optional sitemap tag giving the date a page was last modified, in W3C Datetime format. Google uses it only when it is consistently and verifiably accurate, and counts significant changes to main content, structured data or links, not a copyright-year edit. In a sitemap index it describes the sitemap file, not the pages.
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
<lastmod> inside <url><lastmod> inside <sitemap> in an indexThe index form lets crawlers fetch only sitemaps changed since a given date, which sitemaps.org says helps them find new URLs on large sites. For the file limits and index structure, see the XML sitemap page.
YYYY-MM-DD is valid<!-- sitemap-pages.xml -->
<url>
<loc>https://example.com/guides/canonical-urls</loc>
<lastmod>2026-10-14</lastmod>
</url>
<!-- sitemap-index.xml -->
<sitemap>
<loc>https://example.com/sitemap-pages.xml</loc>
<lastmod>2026-10-14T08:30:00+00:00</lastmod>
</sitemap>Google ignores <priority> and <changefreq>, so lastmod is the one optional freshness field it reads. Time spent on the other two is wasted.
curl -s https://example.com/sitemap.xml \
| grep -o '<lastmod>[^<]*</lastmod>' \
| sort | uniq -c | sort -rn | head
# One date with thousands of hits means lastmod is a build timestampRun the command. A handful of dates across many URLs means real edits. One date repeated everywhere means it tracks deploys.
Pick a URL, check its last real content edit in your CMS or Git history, and compare it with the sitemap value.
Generate the date from the content's modified field, and leave the tag out where you have no reliable date. It is optional.
Submit the sitemap in Google Search Console and review it there.
2 questions people ask next, answered from the sources on this page.
No. It is optional. If you cannot supply a date that tracks real content changes, leave it out rather than send values Google may not trust.
It can. sitemaps.org specifies W3C Datetime, which permits a date alone such as 2026-10-14 or a full timestamp with a time zone. Google's examples use the date-only form.
The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.