Sitemap Protocol Reference

sitemap.xml and sitemap-index elements with frequency, priority and news extensions.

Reference for the XML Sitemap Protocol covering urlset, url, loc, lastmod, changefreq and priority elements, the sitemap index format and the image, video and news extensions.

What is the difference between a sitemap and a sitemap index?

A sitemap is a urlset listing individual page URLs. A sitemap index is a sitemapindex listing other sitemap files. You need an index when a single sitemap would exceed 50,000 URLs or 50 MB uncompressed, splitting the URLs across multiple child sitemaps.

The XML Sitemap Protocol

A sitemap is an XML file that lists a site’s URLs so crawlers can discover and prioritise them. The protocol defines a small set of elements — urlset, url, loc, lastmod, changefreq, priority — plus a sitemapindex format for large sites and extensions for images, video and news. This reference lists each element with its meaning, format and constraints.

How it works

A basic sitemap wraps URL entries in a namespaced urlset:

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

When you exceed 50,000 URLs or 50 MB, split the file and list the parts in an index:

<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://example.com/sitemap-1.xml</loc>
    <lastmod>2026-06-06</lastmod>
  </sitemap>
</sitemapindex>

Reference the file from robots.txt and submit it in Search Console.

Tips and notes

  • loc is the only required child of url; everything else is optional.
  • All loc URLs must share the host and scheme of the sitemap’s location.
  • lastmod is the hint Google actually uses — keep it truthful; changefreq and priority are largely ignored by Googlebot.
  • Limits: 50,000 URLs and 50 MB uncompressed per file; gzip-compress large files.
  • Extensions add namespaces: image:image, video:video, and news:news for Google News (which expects entries within ~2 days of publication).