By SitemapFixer Team
Updated April 2026

Sitemap Lastmod: Complete Guide to Using It Right

Check whether your sitemap's lastmod values are accurate and helpful.Check My Sitemap Free

The lastmod tag in an XML sitemap is one of the most misused elements in SEO. When used correctly, it helps Googlebot prioritize re-crawling pages that have genuinely changed. When used incorrectly — for example, setting every URL to today's date regardless of actual changes — it trains Google to ignore your lastmod values entirely, reducing the usefulness of your sitemap.

What Is Lastmod and Why Does It Matter?

The <lastmod> tag tells crawlers when a URL was last significantly modified. Google uses this as one of many signals to decide how frequently to re-crawl a page. If you accurately report that a page changed yesterday, Googlebot is more likely to prioritize re-crawling it soon. This is particularly valuable for time-sensitive content — news articles, product pages with updated prices, or documentation. Google has publicly stated it only respects lastmod when it consistently reflects real content changes.

Correct Date Formats for Lastmod

The sitemaps.org protocol requires lastmod values to conform to the W3C datetime format. The simplest and most widely used format is the date-only form:

<lastmod>2026-04-27</lastmod>

You can also include time and timezone information for higher precision:

<lastmod>2026-04-27T14:30:00+00:00</lastmod>

Invalid formats like 04/27/2026 or April 27, 2026 will cause parsing errors. Always use the ISO 8601 standard (YYYY-MM-DD).

The Biggest Lastmod Mistake: Faking Dates

The most damaging lastmod pattern is dynamically setting all URLs to the current date on every sitemap regeneration, regardless of whether the content actually changed. This practice was popular years ago under the mistaken belief it would trigger more frequent crawling. In reality, Google detects this pattern quickly — when it crawls pages and finds no meaningful content changes despite a fresh lastmod date, it learns to distrust your dates and may crawl your site less efficiently. Only update lastmod when content genuinely changes.

When Should You Omit Lastmod?

If you cannot reliably track when pages were last modified — for example, on a static site built from a template system that regenerates all pages at once — it is better to omit the lastmod tag entirely than to provide inaccurate values. Google's own guidance confirms this: no lastmod is better than wrong lastmod. Crawlers fall back to their own content-change detection signals (like ETag headers and actual content diffs) when lastmod is absent, which is more accurate than consistently stale or incorrect dates.

How to Generate Accurate Lastmod Values

The best source for lastmod values is your CMS's "last modified" field — the timestamp of the last actual content edit. In WordPress, this maps to the post_modified field. In headless CMS setups (Contentful, Sanity, etc.), it's the updatedAt timestamp. For static sites, you can derive lastmod from the file system's last-modified timestamp or from git commit history. Avoid using build timestamps or deployment dates, as these change even when the underlying content has not.

Lastmod vs. Changefreq: What's the Difference?

While lastmod is a specific timestamp, changefreq is a hint about how often a page typically changes (daily, weekly, monthly, etc.). Google has publicly stated it ignores changefreq entirely, making it essentially useless in modern SEO. Lastmod, by contrast, is used when it's accurate. Focus on maintaining reliable lastmod values and skip changefreq altogether — or include it only for legacy compatibility with non-Google crawlers that may still read it.

Lastmod in Sitemap Index Files

Sitemap index files can also include lastmod for each child sitemap reference. This tells crawlers which child sitemaps have been updated recently, allowing them to skip re-fetching unchanged sub-sitemaps. For large sites with thousands of URLs split across many sitemaps, this can meaningfully improve crawl efficiency. Update the sitemap index's lastmod for a child sitemap only when that child sitemap's contents have actually changed.

Verifying Lastmod Is Working

You can partially verify that Google is using your lastmod values by monitoring the "Last crawled" dates in Google Search Console's URL Inspection tool. Pages with recently updated lastmod values should show more recent crawl dates than pages left unchanged. This is not a perfect correlation — crawl frequency depends on many factors — but a consistent pattern of recently updated pages getting quicker re-crawls confirms Google is taking your lastmod data seriously.

Common Lastmod Errors to Audit

Run a sitemap audit to check for: lastmod dates set in the future (impossible and untrustworthy), dates before the domain was registered (likely a bug in the date field), all URLs sharing an identical lastmod timestamp (bulk-faked dates), or dates more than several years old on active content pages. Any of these patterns signals a misconfiguration. SitemapFixer's sitemap checker flags these automatically so you can correct them without manually inspecting every entry.

Audit Your Sitemap's Lastmod Values
Free sitemap analysis in 60 seconds
Check My Sitemap Free

Related Guides