SEO
Correct lastmod in sitemaps: a real date or nothing
lastmod is the date of the last significant change to a URL. Google uses it only when it is consistent and verifiable, and drops a repeated deploy date.
Key points
- lastmod is the date of the last significant change to a URL, not the date of the last deploy.
- Google uses lastmod only when it is consistent and verifiable against the page.
- Google ignores priority and changefreq: the file keeps loc, lastmod and the hreflang annotations.
lastmod is the date of the last significant change to a URL inside the sitemap, and it counts only when it is true. Google uses it when it is consistent and verifiable; a deploy date copied onto every URL teaches the crawler to ignore the field.
What significant means
Google's documentation on building sitemaps, read on 1 November 2026, states that lastmod must reflect the date and time of the last significant update: a change to the main content, the structured data or the links counts, a change to the copyright year does not. The same document notes that Google ignores priority and changefreq, which remain in the sitemaps.org protocol but not in the calculation.
The distribution is the test
cat > lastmod.mjs ([\s\S]*?)/g)].map((m) => m[1]);
const date = (u) => (u.match(/([^/) || [])[1];
const missing = urls.filter((u) => !date(u)).length;
const days = {};
for (const u of urls) {
const d = date(u);
if (d) days[d] = (days[d] || 0) + 1;
}
console.log(`${urls.length} url, ${missing} without lastmod`);
console.log(days);
EOF
curl -s https://ui.eneawork.it/sitemap-blog.xml > sitemap-blog.xml
node lastmod.mjs sitemap-blog.xml
The script splits the file into <url> elements, counts the ones without a <lastmod> and groups the dates. The result is diagnostic: when nearly every URL shares one day, the value comes from the deploy, not from the change. In our case 578 URLs out of 916 carry the same date, so the field describes a mass publication, not 578 edits.
The three rules
- One date per URL, taken from the content updatedAt, not from a global variable.
- W3C format: YYYY-MM-DD, or a full date and time with a timezone, for example 2026-11-01T23:10:00+01:00.
- No future dates: a lastmod of tomorrow cannot be verified and gets discarded.
- When the date does not exist, omit the element: Google documents that an unreliable lastmod is worse than none.
The EneUI catalogue
The same rule holds for the 1,556 pages under /blocks, for the 30 categories such as /blocks/category/table with 13 blocks and for the 12,808 grids under /icons. Every URL in the sitemap carries one date, and the two hubs without lastmod are a choice, not an oversight: a hub that changes on every publication would skew the average. Checked on 1 November 2026.
The limitation
lastmod does not speed up crawling and is not a promise: it is a hint Google compares against the page, and it drops the hint when it does not hold. Our own file shows it: 84 URLs claim a future date, and most share a deploy day. The field is easy to get wrong precisely because no XML validator complains about a plausible date.
Where to continue
The difference between an index and a single file is in sitemap index or single file; automatic generation in the App Router is in generated sitemaps and robots in Next.js; the sequence for getting indexed is in getting a site indexed by Google.
Frequently asked questions
What format does lastmod need?
A W3C date: YYYY-MM-DD, or a full date and time with a timezone. The format also accepts year and month alone, but a full date is more useful and easier to verify.
Can I omit lastmod?
Yes, and often you should. A missing element is valid; a false date is not. When the CMS does not know the date of the last significant change, omitting is the correct choice.
Does Google use priority and changefreq?
No. Google documents that it ignores both. They remain valid for the sitemaps.org protocol, but they do not change crawling and they make the file longer.
Why does my sitemap show a single date?
Because the generator writes the build date onto every URL. You need one date per record, taken from the item that changes, otherwise the field cannot tell an updated page from one frozen for months.
Is a future date an error?
Yes. The crawler cannot verify it, so it discards it and loses trust in the field. Our file had 84 of them, measured on 1 November 2026: the kind of error a script finds in a second.