XML Sitemaps: Structure, Size Limits and Accurate lastmod
An XML sitemap is a list of URLs you want search engines to know about, with optional metadata. It helps discovery, especially for new or poorly linked pages, but it does not guarantee crawling or indexing. A sitemap is most useful when it is accurate, because engines learn to ignore files that contradict what they find on the site.
Structure and limits
Each sitemap file may contain up to 50,000 URLs and must stay under 50 MB uncompressed. Larger sites split URLs across several files and list them in a sitemap index. URLs must be absolute and belong to the host where the sitemap is served, unless ownership of the other host has been verified.
Encode the file as UTF-8 and escape special characters such as ampersands in URLs.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/guides/sitemaps/</loc>
<lastmod>2026-10-20</lastmod>
</url>
</urlset>What to include and leave out
List only canonical URLs that return 200 and are allowed to be indexed. Leave out redirects, error pages, URLs blocked by robots.txt and pages carrying noindex. Every excluded type sends a mixed signal and makes reports about sitemap coverage harder to read.
Google ignores the priority and changefreq fields, so there is little value in maintaining them. Spend the effort on keeping the URL list and lastmod correct instead.
Making lastmod trustworthy
Set lastmod to the date the main content of the page last changed meaningfully, not the time the sitemap was generated. If every URL shows today's date on every build, engines cannot tell which pages actually changed and may stop relying on the value.
Submit the sitemap once in each search console and reference it in robots.txt. After that, keeping the file current matters more than resubmitting it.