XML Sitemaps: How to Create, Submit and Maintain Them for SEO
An XML sitemap tells Google what pages to index. Learn how to create one, what to include (and exclude), and how to submit it via Google Search Console.
An XML sitemap is a file that lists every URL on your website, helping Google and other search engines discover and index your pages. Without one, crawlers might miss new content, especially on large sites or sites with weak internal linking.
Basic XML Sitemap Structure
<?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-01-15</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://example.com/blog/post-1</loc>
<lastmod>2026-01-10</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>What to Include and Exclude
- Include: Canonical URLs of all important pages, blog posts, product pages, category pages
- Exclude: Pages with noindex, duplicate content, admin pages, cart/checkout pages, search result pages
Priority and changefreq: What Google Says
Google has confirmed it largely ignores the priority and changefreq fields. What it does use: lastmod(if it's accurate โ Google checks). Set lastmod only when you actually update content.
Submitting to Google Search Console
- Go to Google Search Console โ Sitemaps
- Enter your sitemap URL (e.g., example.com/sitemap.xml)
- Click Submit
- Monitor for errors in the Coverage report
Sitemap Index for Large Sites
A single sitemap can contain up to 50,000 URLs and must be under 50 MB. Large sites should use a sitemap index file that references multiple individual sitemaps: one for blog posts, one for products, one for categories, etc.