All posts

XML Sitemaps Explained: lastmod, changefreq, and priority

July 11, 2026 · DevTools

seo
sitemap
xml
guide

An XML sitemap is a machine-readable list of the URLs on your site that you want search engines to know about. It doesn't guarantee indexing, but it helps crawlers discover pages — especially ones that aren't well linked internally — and gives them hints about freshness.

The minimum valid sitemap

At its core, a sitemap is a <urlset> with one <url> per page, each carrying a <loc>:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/</loc>
  </url>
  <url>
    <loc>https://example.com/blog</loc>
  </url>
</urlset>

Two things trip people up: URLs must be absolute (including the scheme), and special characters must be XML-escaped — an & in a query string has to become &amp; or the file is invalid.

The optional tags — and how much they matter

  • <lastmod> — the last modification date. This is the one Google actually pays attention to, if it's accurate. Lying about it (stamping every page with today's date) teaches crawlers to ignore it.
  • <changefreq>daily, weekly, etc. Largely treated as a weak hint or ignored by Google, but harmless to include.
  • <priority> — a 0.0–1.0 relative importance. Also mostly ignored by Google; it does not affect ranking, only (occasionally) crawl ordering within your own site.

Don't over-invest in changefreq and priority. Accurate <loc> and honest <lastmod> are what count.

Wire it up

Reference your sitemap from robots.txt with a Sitemap: line and submit it in Search Console. The Sitemap.xml Generator turns a plain list of URLs into a valid, properly escaped file in seconds, and the Robots.txt Generator adds the matching Sitemap: directive.

Tools mentioned in this post