Keep Sitemap Dates Tied to Real Page Changes
Separate page updates from sitemap generation, run a fictional three-page date audit, and keep the source record behind each lastmod value.

Set a page’s sitemap lastmod from its latest significant published change, not from the time a build or review ran. Before moving a date forward, identify what changed on that exact URL and keep the original publication date separate.
A rebuild can touch hundreds of files while leaving the useful information on their pages unchanged. If every sitemap entry receives today’s date, the file describes the build schedule instead of the pages. The opposite error is possible too: an important correction goes live, but the sitemap still carries an old date.
For a founder maintaining a small site, the practical question is not “How do I make every URL look fresh?” It is “Which page changed, what changed, and which saved record supports its update date?”
Choose the timestamp that describes the page
Keep three events separate: first publication, the latest significant page update, and sitemap generation. They may happen on different days. Rebuilding the sitemap should not automatically replace either of the first two records.
Google’s sitemap guidance says it uses lastmod when the value is consistently verifiable. It gives main-content, structured-data and link changes as examples of significant updates; a copyright-date change alone does not qualify. That is a reason to examine the actual difference, not a reason to treat every edit as equivalent.
A corrected setup step or a changed fact can warrant review of the page’s update date. A teammate opening the editor and finding nothing to change is a different event. Keep that review in the editorial record without presenting it as a newly updated article.
Bing’s explanation of the tag also distinguishes content modification from sitemap generation. We do not use its historical study percentages to predict what will happen to this site or a reader’s rankings.
Review dates against a small change record
Consider three fictional pages in an invented release. A was unchanged but its sitemap date advanced. B received a significant correction but its sitemap date stayed put. C was unchanged and kept its previous date.
The exercise supplies those change observations. A program cannot infer them from the date string alone. A and B should go back to a reviewer; C is consistent with the supplied record, which is narrower than proving that every timestamp is correct.
Run this local example with Python. It parses only the XML included in the code; it does not crawl a site or modify a live sitemap.
import xml.etree.ElementTree as ET
xml = """<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url><loc>https://example.com/a</loc><lastmod>2026-11-10</lastmod></url>
<url><loc>https://example.com/b</loc><lastmod>2026-11-08</lastmod></url>
<url><loc>https://example.com/c</loc><lastmod>2026-11-08</lastmod></url>
</urlset>"""
history = {
"https://example.com/a": ("2026-11-08", False),
"https://example.com/b": ("2026-11-08", True),
"https://example.com/c": ("2026-11-08", False),
}
ns = {"s": "http://www.sitemaps.org/schemas/sitemap/0.9"}
for entry in ET.fromstring(xml).findall("s:url", ns):
url = entry.findtext("s:loc", namespaces=ns)
current = entry.findtext("s:lastmod", namespaces=ns)
previous, significant_change = history[url]
review = (current != previous) != significant_change
print(url, "review_date" if review else "consistent_with_record")
The output flags A and B as review_date and C as consistent_with_record. The rule asks whether the date moved in the same release where the supplied record says a significant change occurred. It does not select a replacement date, validate all XML fields, detect every kind of editorial change or establish that a search engine fetched the page. The ElementTree documentation describes the XML parser used here.
For a real release, attach the actual published change and its reliable time to the review. If the history is incomplete, retain that uncertainty and find the source record rather than stamping the whole site with today’s date.
Distinguish a page entry from a sitemap index entry
The same tag has different referents. Inside a URL entry, lastmod describes the linked page. Inside a sitemap index entry, it describes the child sitemap file. The Sitemaps protocol makes this distinction explicit.
That matters when one new article changes a child sitemap containing many older articles. The child file has changed; that does not mean every page listed in it changed. Inspect the actual public child file reached through the root index, especially if your deployment uses versioned files or redirects.
Use a format supported by the protocol, and preserve the precision your records support. Do not invent a time of day to make a date-only record look more exact. This exercise uses dates for simplicity; a production timestamp needs the appropriate timezone information when a time is supplied.
Confirm the published result without rewriting history
After the release, fetch the public sitemap through its normal URL and locate the exact canonical page. Compare the emitted value with the saved significant-update record. Check the page’s visible dates and structured metadata too: they should describe their respective events honestly, rather than contradicting a real publication history.
A compact handoff is enough:
Canonical URL and original publication date:
Significant change and evidence:
Time of that published change and source record:
Expected page lastmod and actual public XML value:
Child sitemap/index checked and remaining uncertainty:
If a sitemap points to an alternate URL, resolve the canonical question before treating its date as the whole problem. If the page is crawlable but absent from search, use the crawl-permission versus indexing distinction to choose the next check. A repaired date is a more truthful signal, not proof of a crawl, an index entry or a ranking improvement.

