Sub topic 10
Using lastmod honestly, and fields crawlers ignore
This chapter assumes you can read a basic sitemap file, know what a <url> entry with a <loc> looks like, and understand that a sitemap lists URLs you want crawlers to discover. Here we look at the optional fields inside each <url> entry. One of them helps when you use it correctly. Two of them are ignored.
What lastmod tells a crawler
<lastmod> states when a page last changed in a meaningful way. A crawler can compare that date with the last time it fetched the page. If the date is newer, the page is a good candidate for a re-crawl. If the date is unchanged, the crawler may skip it and spend its time elsewhere.
The value must be in W3C date and time format. Both of these are valid:
2026-11-01(date only)2026-10-15T09:30:00+00:00(date, time, and time zone offset)
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.com/</loc>
<lastmod>2026-11-01</lastmod>
</url>
<url>
<loc>https://www.example.com/blog/first-post</loc>
<lastmod>2026-10-15T09:30:00+00:00</lastmod>
</url>
</urlset>Using lastmod honestly
Crawlers learn how much to trust your dates. If a site reports that every page changed today, the crawler sees that the dates carry no information and can stop using them for that site. An honest value has to meet three conditions.
- It reflects a significant change to the main content, structured data, or links on the page.
- It does not change for trivial edits, such as a new copyright year in the footer, a rotated sidebar widget, or a refreshed timestamp in the page template.
- It is not set to the time the sitemap was generated.
A common mistake is to fill lastmod with the current time on every build. The sitemap then claims that all pages changed on every deploy. Store a real modification date with each page, for example the date of the last content edit in your database or the last Git commit that touched the page's source file. Then copy that value into the sitemap.
Fields crawlers ignore
The sitemap protocol also defines two other optional tags:
| Tag | Intended meaning | Current behavior |
|---|---|---|
| `<priority>` | Importance of the URL relative to others on your site, from 0.0 to 1.0 | Ignored by Google |
| `<changefreq>` | How often the page is expected to change, such as `daily` or `monthly` | Ignored by Google |
Both tags were easy to misuse. Many sites set every page to priority 1.0 or daily, so the values said nothing useful. Major search engines no longer rely on them. Including them does no harm, but they add file size and give you something to maintain with no benefit. You can omit them. Use <loc> and an accurate <lastmod> and leave it there.
If you have no reliable modification date for a page, leave lastmod out. A missing value is better than a false one.
Common errors
- Using a format such as
11/01/2026orNov 1, 2026. Crawlers expect the W3C format. - Leaving out the time zone offset on a datetime value, which makes the time ambiguous.
- Updating
lastmodon every page when only a shared template changed. - Setting
lastmodin the future.
Exercise
Your sitemap generator writes the build time into lastmod for every URL, and you deploy several times a day. Why is this a problem, and what should the generator use instead?
Show answer
Every page then appears to change on every deploy, so crawlers learn that your dates are unreliable and may ignore them. The generator should use a stored modification date for each page, such as the last content edit time, and omit lastmod when no reliable date exists.