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. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

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.

Element reference

ElementRequiredValueNotes
urlsetYes (root)Namespace http://www.sitemaps.org/schemas/sitemap/0.9Wraps all url entries
urlYesContainerOne per page
locYesAbsolute URLMust match the sitemap host; escape & as &
lastmodNoW3C datetime (e.g. 2026-06-06)The hint Google actually reads; keep it accurate
changefreqNoalways / hourly / daily / weekly / monthly / yearly / neverLargely ignored by Googlebot
priorityNo0.01.0, default 0.5Relative within your site; does not affect cross-site ranking

For a sitemap index, replace urlset with sitemapindex and url/loc with sitemap/loc.

Minimal valid sitemap

<?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 with a Sitemap: directive and submit it in Google Search Console and Bing Webmaster Tools.

Extensions: image, video and news

The core protocol covers HTML pages. Three official namespace extensions add richer metadata:

Image extension (xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"): Add image:image / image:loc children under each url to tell Google about embedded images. Useful for photography sites, e-commerce product images, and image galleries.

Video extension (xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"): Declare video title, description, thumbnail, and duration inside a video:video block. Required for Google to show video results with rich preview data.

Google News extension (xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"): Add news:news blocks with publication name, language, and publication date. Google News only indexes articles published within the past two days, so this sitemap must be regenerated continuously on news sites.

Key rules and common mistakes

  • loc is the only required child of url. Omitting lastmod is fine; a missing or stale lastmod is worse than no lastmod.
  • All loc URLs must share the host and scheme of the sitemap’s own URL — a sitemap at https://example.com/sitemap.xml cannot list http://other.com/page.
  • Limits: 50,000 URLs and 50 MB uncompressed per file. Gzip-compress large sitemaps (.xml.gz) to stay under the transfer threshold.
  • changefreq and priority are largely ignored by Googlebot; investing time in accurate lastmod values is far more worthwhile.
  • Sitemaps only help with discovery, not ranking. A URL in a sitemap still needs inbound links and good content to rank.