XML sitemap
<lastmod>
When the page last changed. The one piece of sitemap metadata search engines still act on — and only if you keep it honest.
<lastmod> takes a W3C Datetime: a date alone, or a date and time with a timezone offset. Both are legal, and a bare date is the common choice. What is not legal is any of the other date formats a template might emit — RFC 822, a US-style date, or a timestamp with no offset.
Google has said publicly that it uses lastmod when it is consistently accurate and ignores it entirely when it is not. Stamping every URL with the build time is therefore worse than omitting the element: it costs the signal for every page rather than just the ones that changed.
- Format
- XML sitemap
- Namespace
- Sitemap protocol 0.9
- Parent
- <url>
- How many
- At most one per <url>.
Cardinality and constraints
At most one per <url>.
- W3C Datetime: 2026-08-10, or 2026-08-10T09:00:00+00:00. A time without an offset is not valid.
- Should reflect the content's last meaningful change, not the deploy or the crawl.
- A sitemap where every entry shares one timestamp is treated as having no signal at all.
What our validator does
The validator reports how many entries carry a <lastmod>, warns when none do, and warns when the freshest is more than thirty days old.
Broken and fixed
Both documents below are well-formed XML — that is the point of this corpus — and both are run through the validator on every test run. The verdicts here are what it returned, not what we expect it to.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url><loc>https://example.com/</loc></url>
</urlset>No URLs have a <lastmod>; crawlers can't tell what changed.<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/</loc>
<lastmod>2026-08-10</lastmod>
</url>
</urlset>Where it reaches
- Datatypesxs:dateThe lexical rules a bare-date lastmod has to follow, with literals put through the validator.
- Datatypesxs:dateTimeAnd the rules for the fuller form, including the offset that is not optional.
- ToolsSitemap validatorReports lastmod coverage and freshness for your own file.
Related elements
- <url>One entry in a sitemap: a required <loc> plus the optional metadata a crawler may or may not use.
- <changefreq>A hint at how often a page changes, drawn from a fixed list of eight values — and ignored by every major search engine.
- <lastmod>When a child sitemap last changed — the element that lets a crawler skip a file it has already seen.
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.