lastmod is the optional sitemap tag that says when a page last changed. It is the only one of the three optional tags that Google and Bing use, and they use it only when it is true. The other two, priority and changefreq, are ignored by both. This guide quotes what each search engine says, shows the date format, and gives code to set lastmod honestly and to audit it.
To see whether your own dates look trustworthy, run your sitemap through the free sitemap validator. It flags dates in the future, dates in the wrong format, and sitemaps where nearly every URL shares one date.
Sources: Bing’s study of sites with at least one URL in its index[7]; Google[2]. The Wix figure is what its sitemap served when we checked it.
What lastmod means
The protocol defines <lastmod> as “the date of last modification of the page”, in W3C Datetime format, and adds: “the date must be set to the date the linked page was last modified, not when the sitemap is generated”[5]. Bing says it added that sentence to sitemaps.org after finding that most wrong dates were generation dates[7]. It sits inside each <url>, next to <loc>:
<url> <loc>https://www.example.com/guides/sourdough</loc> <lastmod>2026-10-21</lastmod> </url>
In a sitemap index, <lastmod> means something else: when the child sitemap file changed, which “does not correspond to the time that any of the pages listed in that Sitemap were changed”[5]. And the tag is separate from the If-Modified-Since and 304 mechanism, which search engines “may use” differently[5].
What Google and Bing say they use
Advice on lastmod is confusing because the search engines changed their position. Here is the record, oldest first, so you can tell an old quote from a current one.
Sources: 2015[9]; Bing 2023[7]; Google 2023[2]; WordPress 6.5[10]; Bing 2025[8].
Google, today
Google’s documentation says: “Google uses the <lastmod> value if it’s consistently and verifiably (for example by comparing to the last modification of the page) accurate.” And it defines the change that counts: “an update to the main content, the structured data, or links on the page is generally considered significant, however an update to the copyright date is not”[1]. Its 2023 post adds the warning: “if your page changed 7 years ago, but you’re telling us in the lastmod element that it changed yesterday, eventually we’re not going to believe you anymore”[2]. Search Console’s help even recommends lastmod as the way to flag many updated pages: “submit a sitemap, with the updated pages marked by <lastmod>”[4].
The same post makes a point most guides miss: you do not have to date every URL. “You can use a lastmod element for all the pages in your sitemap, or just the ones you’re confident about.” A home page or category page that only aggregates other pages can leave it out[2].
Bing, today
Bing calls lastmod “a key signal, helping Bing prioritize URLs for recrawling and reindexing, or skip them entirely if the content hasn’t changed since the last crawl”, and asks for ISO 8601 dates “including both the date and time”[8]. It also says identical dates are not automatically wrong: sites may publish several pages on the same day, “however, if we observe that the dates are consistently set to the current date, we will suspect the validity of those dates and may disregard them”[7].
Priority and changefreq: ignored
| Protocol says | Bing | ||
|---|---|---|---|
| lastmod | Date the page was last modified, not the sitemap | Used if consistently and verifiably accurate | A key signal for recrawling |
| priority | 0.0 to 1.0, default 0.5, relative to your own pages | "Doesn't use" | Ignored |
| changefreq | always to never; "a hint and not a command" | "Doesn't use" | Ignored |
Sitemap priority. Google: “Google still doesn’t use the changefreq or priority elements at all.” Priority “is a heavily subjective field” that “generally doesn’t accurately reflect the actual priority of a page”[2]. Bing: they “are ignored by Bing and do not influence how your content is crawled or ranked”[8]. The protocol never promised a ranking effect anyway: priority “is not likely to influence the position of your URLs in a search engine’s result pages”[5]. Yoast removed priority from its sitemaps in version 3.5 for this reason[11].
changefreq. The protocol lists seven values, always, hourly, daily, weekly, monthly, yearly and never, and warns that crawlers may visit “hourly” pages less often and “yearly” pages more often[5]. Google notes that “changefreq specifically is also conceptually overlapping with lastmod”[2]. A true date says more than a guess about frequency.
Neither tag is an error, so you need not rush to remove them. They just do nothing, and time spent tuning them is wasted.
The lastmod date format
The W3C note defines six levels of precision, from a year alone to fractions of a second. For dates with a time it requires a time zone designator, “Z or +hh:mm or -hh:mm”[6]. Search Console accepts the date alone or a full date and time, and says the time is optional and “defaults to 00:00:00Z”, “but if you do specify a time, you must also specify a time zone”[3].
<!-- Valid W3C Datetime --> <lastmod>2026-10-21</lastmod> <lastmod>2026-10-21T09:15:00+00:00</lastmod> <lastmod>2026-10-21T09:15:00Z</lastmod> <lastmod>2026-10-21T11:15:00+02:00</lastmod> <!-- Invalid --> <lastmod>21/10/2026</lastmod> <!-- day-first --> <lastmod>2026-10-21 09:15:00</lastmod> <!-- space instead of T, no time zone --> <lastmod>2026-10-21T09:15:00</lastmod> <!-- a time with no time zone -->
Which to choose? A plain date is the simplest valid value. Bing prefers date and time, because “including a timestamp provides a more precise signal”[8]. If your system stores a precise update time, use it with a zone; if it only knows the day, the day is fine. An invalid value shows up in Search Console as “Invalid date”[3].
How to set lastmod honestly
The goal is simple to say: the date changes when the page changes, and only then. Three ways to get there.
- Use the CMS’s real modified date. WordPress 6.5 added lastmod “for the individual posts and the homepage entries” in core sitemaps[10]. Most CMSs keep an
updated_atper record. Check it moves only on edits you would call significant, not on every save, view count or plugin update. - Leave it out where you cannot be sure. Google allows dating only the pages you are confident about[2]. An undated URL is better than a falsely dated one.
- Fingerprint the content. If your pages are generated, store a hash of the significant parts and move the date only when the hash changes. A sketch:
// Bump lastmod only when the content that matters changes.
// Our suggestion, not a documented requirement: hash the parts Google calls
// significant (main text, structured data, links), not the whole HTML.
import { createHash } from "node:crypto";
type Page = { body: string; jsonLd: string; links: string[]; lastmod?: string; hash?: string };
export function nextLastmod(page: Page, now = new Date()): { lastmod?: string; hash: string } {
const hash = createHash("sha256")
.update(page.body)
.update(page.jsonLd)
.update(page.links.join("\n"))
.digest("hex");
// Unchanged: keep the old date (or none). Changed: today's date, in UTC.
if (hash === page.hash) return { lastmod: page.lastmod, hash };
return { lastmod: now.toISOString().slice(0, 10), hash };
}On a Next.js site, pass that date as lastModified in app/sitemap.ts; the Next.js sitemap guide shows where, and why the docs example’s new Date() is the wrong default.
How to audit your dates
The fastest check is to count how many URLs share each value:
# How many URLs share each lastmod value? (bash, macOS, Linux, WSL) curl -s https://www.example.com/sitemap.xml \ | grep -o '<lastmod>[^<]*</lastmod>' \ | sort | uniq -c | sort -rn | head -5 # 8282 <lastmod>2026-10-04T00:52:57+00:00</lastmod> <- one value on most URLs: suspicious # 18 <lastmod>2026-07-20T00:00:00+00:00</lastmod>
The sample output is real: it is what www.wix.com’s sitemap gave on 11 October 2026, where 8,282 of 10,525 URLs, 79%, carried the same timestamp. One more date was in the future, 2026-12-18, which cannot be accurate. Other sites we checked the same day show the range:
- Stripe leaves lastmod out entirely: none of the 2,641 URLs in the files we read had one. That is allowed, and honest, but it gives search engines no freshness signal.
- Yoast dates most URLs individually, with 128 of 1,698 entries undated, which is consistent with Google’s advice to date only what you are sure of.
- nextjs.org dates all 713 URLs, with 49 different values; the most common covers 29%.
A shared date is not proof of a problem: Bing itself says many pages can legitimately change on one day[7]. The signal is a shared date that is also the latest one, on most of the site, every time you look. Compare a few dates with the pages: if a page dated yesterday has not changed in a year, the generator is writing its own run time.
Where IndexNow fits
lastmod waits for a crawler to read your sitemap. Bing revisits a known sitemap “typically at least once per day”[8]. IndexNow works the other way: you notify participating search engines the moment a URL is “added, updated, or deleted”, with up to 10,000 URLs in one POST, after proving ownership with a key file at your site root[12]. Bing recommends both: a complete sitemap with accurate lastmod for coverage, and IndexNow for “real-time URL submission”[8].
For Google, the old shortcut is gone. Google retired its sitemap ping endpoint in 2023, and pings to it now return a 404; robots.txt and Search Console remain[2]. The Bing Webmaster Tools guide includes an IndexNow key and request builder.
New to sitemaps? Start with what a sitemap is. If Search Console cannot read the file at all, see sitemap could not be read.
Questions people ask
What is lastmod in a sitemap?
lastmod is an optional tag inside each <url> entry of an XML sitemap. It gives the date the page was last modified, in W3C Datetime format such as 2026-10-21. The protocol says it must be the date the page changed, not the date the sitemap was generated.
Does Google use lastmod?
Yes, when it is accurate. Google's documentation says it uses the lastmod value if it is consistently and verifiably accurate, and its 2023 blog post called lastmod useful in many cases and a signal for scheduling crawls. If the dates do not match reality, Google says it will eventually stop believing them.
Does sitemap priority matter?
No. Google says it ignores the priority value, and Bing said in 2025 that priority and changefreq are ignored and do not influence crawling or ranking. Even the protocol says priority is not likely to influence your position in results. Leave it out.
What does changefreq do?
Nothing for Google or Bing. changefreq was meant to hint how often a page changes, with values from always to never, but the protocol itself calls it a hint and not a command. Google ignores it, and its 2023 post noted that changefreq overlaps with lastmod.
What format should lastmod use?
W3C Datetime. Use a date alone, YYYY-MM-DD, or a full date and time with a time zone, such as 2026-10-21T09:15:00+00:00. If you include a time, Search Console requires a time zone. Bing recommends including the time.
Should I update lastmod when I fix a typo?
Not for Google. It means last significant modification: changes to the main content, structured data or links count, and a copyright date or a small footer change does not. Moving the date for trivial edits is how dates stop being trusted.
