Key Takeaways
- Accurate lastmod dates tell AI crawlers which pages have been recently updated, helping them prioritize fresh content for crawling and citation
- Fake lastmod dates (setting everything to today) cause search engines to ignore your sitemap dates entirely — a worse outcome than having no lastmod at all
- AI models prefer fresh sources — an accurate lastmod date gets your updated content into AI responses faster than waiting for passive discovery
- Use W3C Datetime format (YYYY-MM-DD or full ISO 8601) consistently across your entire sitemap
- Only update lastmod when the page content actually changes meaningfully — not for minor CSS tweaks or comment additions
Are your sitemap dates helping or hurting? Run a free technical scan to check your sitemap configuration for AI readiness.
Table of Contents
What Is the Lastmod Tag?
The <lastmod> tag is an optional element in XML sitemaps that tells search engines when a URL was last meaningfully modified. Here is how it looks in a sitemap:
<url>
<loc>https://yoursite.com/blog/ai-seo-guide</loc>
<lastmod>2026-03-22</lastmod>
</url>
When a crawler reads your sitemap, it compares lastmod dates against its records. Pages with newer lastmod dates get prioritized for recrawling. Pages with unchanged dates may be skipped until the next regular crawl cycle.
The key word is "meaningfully." Lastmod should reflect changes to the actual content of the page — updated text, new sections, revised pricing, added images. It should not change for cosmetic updates like CSS changes, sidebar widget updates, or new comments (unless comments are a primary content feature).
For the complete XML sitemap setup, see our XML sitemap best practices guide.
How AI Crawlers Use Lastmod
AI search crawlers use lastmod dates at two critical stages:
Crawl prioritization
When an AI crawler reads your sitemap, it has a limited crawl budget — it cannot fetch every page on every visit. Lastmod dates help it decide which pages to prioritize:
- New or recently updated pages (lastmod within the past few days) get crawled first
- Regularly updated pages (lastmod changes frequently) get checked more often
- Stale pages (lastmod unchanged for months) get crawled less frequently
Source freshness evaluation
When an AI model selects sources for a response, content freshness is one of many ranking factors. Pages with recent, verifiable update dates are preferred when multiple sources provide similar answers. A page updated yesterday about "best CRM tools 2026" will generally be preferred over a page last updated in 2024 with the same title.
This creates a virtuous cycle: accurate lastmod dates lead to faster crawling, faster crawling leads to fresher content in the AI's index, and fresher content leads to more citations.
Proper Implementation
Date format
Use W3C Datetime format. Both of these are valid:
<lastmod>2026-03-22</lastmod>
<lastmod>2026-03-22T14:30:00+00:00</lastmod>
Choose one format and use it consistently across your entire sitemap. Mixing formats can confuse some crawlers.
What triggers a lastmod update
Update lastmod when:
- Main body content is added, removed, or substantially rewritten
- Pricing, specifications, or factual data changes
- New sections or FAQ items are added
- Images or media directly related to the content are updated
- The page's title or meta description changes substantially
Do NOT update lastmod when:
- A sidebar widget changes
- A comment is added (unless comments are primary content)
- CSS or JavaScript files are updated
- Navigation menu items change
- A/B test variants are deployed
Common Mistakes
Mistake 1: Setting all lastmod to today's date
The most damaging mistake. Site owners hoping to force recrawling set every URL's lastmod to the current date. Google and Bing detect this pattern and begin ignoring lastmod values from your sitemap entirely. You lose the freshness signal for legitimate updates.
Mistake 2: Omitting lastmod entirely
While less harmful than fake dates, omitting lastmod means crawlers cannot prioritize which pages to visit. They must crawl your entire sitemap evenly, which means truly updated content takes longer to be rediscovered.
Mistake 3: Auto-updating lastmod on every page save
Many CMS platforms update lastmod whenever any edit is saved — even if the edit is a typo fix in a single word. While this is technically accurate, frequent trivial updates dilute the signal. Crawlers learn that your lastmod changes do not correlate with meaningful content changes.
Mistake 4: Using incorrect date formats
Dates like "March 22, 2026" or "22/03/2026" are invalid in XML sitemaps. Use only W3C Datetime format (YYYY-MM-DD).
Mistake 5: Timezone inconsistency
If you include timezone information, be consistent. Mixing UTC, EST, and CET across your sitemap creates confusion and may cause crawlers to misinterpret the relative freshness of pages.
Automating Accurate Lastmod Dates
CMS-level automation
Most CMS platforms can track content modification dates automatically. The key is to distinguish meaningful updates from trivial ones:
WordPress: Use a plugin like Yoast SEO or Rank Math that sets lastmod based on post_modified date. For more control, add a custom field "content_last_updated" that editors manually update only after meaningful changes.
Custom CMS: Track a separate content_modified_at timestamp that is only updated when the main content body changes, not when metadata or settings change.
Build-time generation
For static sites or headless CMS setups, generate lastmod dates during the build process based on file modification timestamps or git commit dates:
# Get last meaningful commit date for a file
git log -1 --format="%aI" -- content/blog/ai-seo-guide.md
# Output: 2026-03-22T14:30:00+00:00
Webhook-based updates
For dynamic sites, trigger a sitemap regeneration webhook whenever content is published or significantly updated. This ensures your sitemap always reflects the actual state of your content.
Freshness and AI Citation
Content freshness is a significant factor in AI source selection. When AI models encounter multiple sources answering the same question, they evaluate several freshness signals:
- Lastmod in sitemap — When the page was last updated according to your sitemap
- Date in content — Publication and modification dates visible on the page
- HTTP Last-Modified header — Server-level modification timestamp
- Content analysis — References to recent events, current year mentions, up-to-date statistics
All four signals should align. If your sitemap says the page was updated in March 2026 but the page content references "2024 statistics" and "best practices for 2024," the conflicting signals reduce trust.
For a deeper dive into freshness optimization, see our guide on content freshness signals for AI.
Combining Lastmod with Other Signals
Lastmod dates work best when combined with other freshness and indexing signals:
Pair with IndexNow
When you update content, update your sitemap's lastmod AND send an IndexNow notification. IndexNow provides instant notification to Bing; the updated lastmod confirms the change for all crawlers.
Align with on-page dates
Ensure the "Last updated" date displayed on your page matches the lastmod in your sitemap. Mismatches erode crawler trust.
Use HTTP Last-Modified header
Configure your server to send the Last-Modified HTTP header matching your sitemap's lastmod date. This triple alignment (sitemap + on-page + HTTP header) provides the strongest freshness signal.
Frequently Asked Questions
What is the lastmod tag in an XML sitemap?
The lastmod tag indicates when a URL was last meaningfully modified, using W3C Datetime format. Crawlers use it to prioritize which pages to recrawl and to assess content freshness.
Do AI crawlers use sitemap lastmod dates?
Yes. AI search crawlers use lastmod to prioritize crawling of recently updated content. Inaccurate dates can cause crawlers to distrust your sitemap entirely.
Should I set all lastmod dates to today to force recrawling?
No. Search engines detect false lastmod dates and will ignore your sitemap's dates entirely, losing the freshness signal for legitimate updates.
What date format should I use for lastmod?
W3C Datetime format: YYYY-MM-DD (e.g., 2026-03-22) or full ISO 8601 with timezone. Use one format consistently.
Does a newer lastmod date help my content get cited by AI?
Indirectly, yes. It helps crawlers discover updates faster, getting fresh content into AI responses sooner. But content quality still determines whether AI cites you.
Get your sitemap AI-ready
AImetrico analyzes your sitemap, lastmod accuracy, and 20+ technical signals for AI visibility.
Trusted by 2,400+ websites