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
locis the only required child ofurl; everything else is optional.- All
locURLs must share the host and scheme of the sitemap’s location. lastmodis the hint Google actually uses — keep it truthful;changefreqandpriorityare 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, andnews:newsfor Google News (which expects entries within ~2 days of publication).