Small SEO Tools

How to Set Different Lastmod Dates in One XML Sitemap

A sitemap regenerated today can still describe pages last changed on different days. Giving every URL the build date hides that difference. For a short, hand-maintained sitemap, keep an update record per page, then add only the dates you can support.

This worked example uses fictional help pages with two known update dates and one unknown date. If your CMS maintains a sitemap automatically, correct its date source rather than replacing its output with another manually maintained file.

Make a page-update ledger before touching the XML

Suppose a site rebuild runs on October 28, 2026. Its editorial record contains these entries:

Page Evidence of the last meaningful change Lastmod decision
/help/packing/ A saved revision replaced the packing procedure on October 2. No later substantive edit is recorded. 2026-10-02
/help/delivery/ A release note and page revision show an updated delivery table on October 20. 2026-10-20
/help/ The overview is assembled from other pages, and its last meaningful change cannot be verified. Omit lastmod for this entry.

For a real site, keep the full URL, date, reason and supporting revision or release reference together. Check what changed on that page; a repository-wide build time or a file-copy timestamp is not a page-content audit.

Separate significant changes from routine rebuilds

Google’s sitemap documentation says lastmod should reflect the last significant update. Main content, structured data and changed links can qualify; a copyright-date change does not. Google uses the value when it is consistently and verifiably accurate.

In this fictional case, a shared footer was refreshed on October 27 without changing the help information. That event does not replace the two recorded content dates. Review each change on its merits rather than automatically treating every template render as significant.

The Sitemaps protocol makes lastmod optional and allows a date-only value in YYYY-MM-DD format. It identifies the linked page modification, not the time the sitemap was generated. Google’s lastmod guidance also permits omission for pages whose update date cannot be determined confidently.

Generate a skeleton without a shared date

The XML Sitemap Generator has one Last modified control for the entire list. A Custom date is applied to every entry; it cannot accept a separate date beside each pasted URL.

  1. Paste these three addresses into Paste your URLs (one per line): https://example.com/help/packing/, https://example.com/help/delivery/ and https://example.com/help/, each on its own line.
  2. Select Omit changefreq, Omit priority and No lastmod.
  3. Select Generate Sitemap. Confirm three URLs, zero invalid lines and zero duplicates, then use Download sitemap.xml.

Do not enter a single date just to fill the field. In this example, choosing October 20 as a global Custom date would incorrectly assign it to the packing page and the unverified overview too. An empty Custom date falls back to today in this tool; select No lastmod deliberately.

Add each verified date to its own URL entry

Open the downloaded skeleton in a text editor. Insert each verified lastmod after its matching loc, inside the same url element. Leave the overview entry without that optional element:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/help/packing/</loc>
    <lastmod>2026-10-02</lastmod>
  </url>
  <url>
    <loc>https://example.com/help/delivery/</loc>
    <lastmod>2026-10-20</lastmod>
  </url>
  <url>
    <loc>https://example.com/help/</loc>
  </url>
</urlset>

Review the URL-date pairs against the ledger after editing. Merely counting two lastmod elements would not catch the two dates being swapped. The generator did not discover or verify these dates; this is a separate manual editing step.

Validate the maintained file after deployment

  1. Open the edited file with an XML-aware parser or editor and check that it parses.
  2. Check every location and its associated date. Confirm that the unknown overview date remains omitted.
  3. After uploading your real file, inspect the public sitemap response and compare it with the saved version.
  4. Regenerate the example URL list without changing any pages. Confirm that your publishing process retains the verified dates rather than resetting them to the rebuild date.

Generating a new skeleton can erase manual additions. Keep the ledger and final XML under the same maintenance process, or use a generator that accepts per-page dates when the list grows. For the broader page-selection and submission steps, see our small website sitemap guide. If a location contains query separators, the XML URL escaping guide covers preserving them through the XML layer.