Guide · sitemap

How do you write a trustworthy sitemap lastmod?

Updated 2026-11-05 · kagentx

Short answer

lastmod should be the time the page content really changed: update it only when the main content, structured data or links change. Google uses lastmod only when it is consistently and verifiably accurate, and Bing says it must not be the sitemap's generation time. Do not use file modified times, do not fingerprint the whole page's HTML, and do not use one date for the whole site. A workable approach is to fingerprint only what the page “says” and record a new time only when the fingerprint changes, which is what MochiStamp does.

What should lastmod say to be trustworthy?

lastmod should be the time the page content really changed. Google's sitemap documentation (checked 2026-11) is specific: Google uses lastmod only if it is “consistently and verifiably” accurate; it should reflect the last significant update to the page, meaning changes to the main content, structured data or links, and changing the copyright year in the footer does not count.

Bing said the same in its 2025-07-31 Webmaster Blog post: lastmod is a key signal for deciding whether to recrawl, it should reflect the true last modification time of the page content and not the time the sitemap was generated, and the recommended format is ISO 8601 with a time. The post also says freshness signals affect how quickly updates show up in search results and AI-generated answers.

Also, Google's documentation says it ignores priority and changefreq, so do not spend time on those two. OpenAI's and Perplexity's crawler documentation pages do not mention sitemaps or lastmod, so we do not say whether it matters to those two.

Which ways of writing lastmod are not trustworthy?

How it is writtenQuestion
Using the file's modified timeDeploys often build from a clean copy of the code, where every file's time is the moment of the deploy, so all pages “update” together.
Using the time the sitemap was generatedBing's blog says explicitly that it should not be the generation time; if it changes on every generation, it is as good as absent.
Fingerprinting the whole page's HTMLAdding one analytics attribute to a button, or restyling, makes a large batch of pages count as changed.
Using one date for the whole sitePages that did not change carry the new date too, so a crawler cannot use it to pick out the pages that really changed.

A real setup: MochiStamp fingerprints what a page “says”

MochiStamp's sitemap (mochistamp.com/sitemap.xml, read 2026-11-05) has 229 URLs, each with a lastmod accurate to the second and with a time zone, with dates spread from 2026-10-16 to 2026-11-05, not one shared date. It works like this:

  1. The fingerprint looks only at what the page says

    For each page it takes: the title, the description, the text inside the main content (main), the addresses that links and images in main point to, and the images' alt text. Styles, classes, analytics data attributes and scripts do not count.

  2. The header, footer and language bar do not count

    They are the same on every page. Adding a link to a new page in the footer should not make every other page look updated.

  3. A new time is recorded only when the fingerprint changes

    The database stores each URL's fingerprint and the time that fingerprint was first seen. If the fingerprint is unchanged, lastmod does not move; if it changed, the time of the change is recorded.

  4. The historical date is not “now”

    When recording began, the database was empty. They replayed every earlier release, and recorded each page as the time of the release where its content last changed, not the day recording first began.

This approach was corrected once, as recorded in the project log (2026-10-30): the first fingerprint included the whole page's HTML, so one release that only added an analytics attribute to a button made 119 pages count as changed. After switching to content only, the same change no longer alters any page's time.

In comparison, Pagent (pagent.kagentx.com/sitemap.xml, read 2026-11-05): all 81 URLs have lastmod 2026-10-27, date only with no time, one value for the whole site, taken from the date the data was updated. That is not wrong for a small site that updates as a whole, but a crawler cannot use it to tell which pages are really new.

How do you make a trustworthy lastmod for your own site?

  1. 1. Decide what counts as a page change

    Body text, title, description, structured data and links count; styles, scripts, the footer copyright year and analytics attributes do not. Write this line down, so that people changing the code do not break it casually.

  2. 2. Fingerprint the content that counts, not the whole page

    At build time, extract the part that counts and hash it. Leave out parts that are the same on every page, such as the header and footer.

  3. 3. Update the time only when the fingerprint changes, and store it

    Store each URL's fingerprint and time in a file or database. On redeploy, compare first: if unchanged, keep the old time. Do not use file times.

  4. 4. Output ISO 8601 with a time and time zone

    Like this. Google's documentation example shows only a date, and Bing recommends including a time; the full form is safer:

    <url>
      <loc>https://example.com/pricing/</loc>
      <lastmod>2026-11-05T00:27:22+09:00</lastmod>
    </url>
  5. 5. Spot-check after going live

    Open the live sitemap.xml, pick a few pages you did not change this time and see whether their dates moved; then pick one you just changed and see whether its date is new.

  6. 6. Notify search engines when needed

    lastmod is about the judgment a search engine makes when it comes to crawl again; to let Bing and other engines know faster, see what IndexNow is.

However accurate lastmod is, it only matters if crawlers can get in and read the text; for those two, see AI visibility audit checklist.

FAQ

Will lastmod make AI cite my pages faster?

There is no guarantee. Bing says lastmod is a key signal for deciding to recrawl and that freshness affects how fast updates show up in search results and AI answers; OpenAI's and Perplexity's crawler documentation does not mention sitemaps or lastmod.

Can lastmod use the file's modified time?

Not recommended. When a deploy builds from a clean copy, every file's time is the moment of the deploy, and every page looks freshly updated. Record the time the page content really changed.

Do I update lastmod when I change the footer's copyright year?

No. Google's documentation says a significant update means changes to the main content, structured data or links, and changing the copyright year does not count.

Do I still need priority and changefreq?

No. Google's documentation says it ignores both values.

Should lastmod be a date or a time?

Google's example has only a date; Bing's blog recommends ISO 8601 with a time. A full time with a time zone suits both, as long as it really is the time the page last changed.

Sources

kagentx

Can crawlers read your pages?
Let the evaluation tell you

The evaluation checks whether crawlers can get in and whether the text is served directly, then asks ChatGPT, Perplexity and Claude (with web search on) your buyers' questions and sees whether you are mentioned. The Basic plan is $1, and results usually take 2–3 minutes.