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
| Element | Required | Value | Notes |
|---|---|---|---|
urlset | Yes (root) | Namespace http://www.sitemaps.org/schemas/sitemap/0.9 | Wraps all url entries |
url | Yes | Container | One per page |
loc | Yes | Absolute URL | Must match the sitemap host; escape & as & |
lastmod | No | W3C datetime (e.g. 2026-06-06) | The hint Google actually reads; keep it accurate |
changefreq | No | always / hourly / daily / weekly / monthly / yearly / never | Largely ignored by Googlebot |
priority | No | 0.0–1.0, default 0.5 | Relative 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
locis the only required child ofurl. Omittinglastmodis fine; a missing or stalelastmodis worse than nolastmod.- All
locURLs must share the host and scheme of the sitemap’s own URL — a sitemap athttps://example.com/sitemap.xmlcannot listhttp://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. changefreqandpriorityare largely ignored by Googlebot; investing time in accuratelastmodvalues 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.