What Is an XML Sitemap?
An XML sitemap is a file listing the URLs on your website that you want search engines to discover and index. It is not required — Google can find pages without one — but it significantly helps search engines understand your site structure, especially for large sites or those with complex navigation.
Basic Structure
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/page</loc>
<lastmod>2026-06-01</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
Key Fields
- loc — full URL including https://. Required.
- lastmod — when the page was last significantly changed. Use ISO 8601 (YYYY-MM-DD).
- changefreq — how often the page changes. Google does not always respect this.
- priority — relative importance from 0.0 to 1.0. Only meaningful relative to your own pages.
Sitemap Index Files
For sites over 50,000 URLs or 50MB, use a sitemap index that references multiple individual sitemaps:
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap><loc>https://example.com/sitemap-pages.xml</loc></sitemap>
<sitemap><loc>https://example.com/sitemap-blog.xml</loc></sitemap>
</sitemapindex>
What to Include and Exclude
Include: All canonical URLs you want indexed — homepage, product pages, blog posts, key landing pages.
Exclude: Pages with noindex tags, admin pages, search result pages, paginated pages beyond page 2, duplicate/thin content, login-required pages.
Submitting to Search Engines
- Submit to Google Search Console under Indexing → Sitemaps
- Submit to Bing Webmaster Tools under Configure My Site → Sitemaps
- Reference in robots.txt:
Sitemap: https://example.com/sitemap.xml
For automated sitemap scanning and API submission on top of sitemap discovery, see our Google indexing service and Search Console indexing workflow.