An XML sitemap is a file that tells Google all the URLs you want indexed. It's not a ranking signal, and it doesn't guarantee indexing. But it's the fastest way to discover new content. When you publish an article, the sitemap is the quickest route for Googlebot to learn about it.
What is an XML Sitemap and When Do You Need One?
A sitemap serves two purposes:
1. Discovery: Helps crawlers find pages they might not discover through internal links alone. This is important for new pages, pages deep in the hierarchy, or pages generated programmatically.
2. Prioritization: Affects crawler attention. A URL present in: internal links + canonical tag + sitemap = higher crawl priority.
Small sites (under 500 pages) may not urgently need one — internal links suffice. Large sites (10,000+ pages) without a sitemap lose the opportunity to get new content discovered.
Basic Structure and Elements
<?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-07-21</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>Elements: - <loc> (Required): The page's canonical URL. Must exactly match the canonical tag. - <lastmod> (Recommended): The actual last update date (YYYY-MM-DD format). Critical: Don't update it without real changes — Google monitors this. - <changefreq>: A hint (often ignored). - <priority>: Relative priority within the site (0.0-1.0). Default is 0.5. Won't affect rankings.
Limits: What to Do at 50,000 URLs
Each sitemap file has two hard limits: - Maximum 50,000 URLs - Maximum 50MB uncompressed
When either is exceeded, use a Sitemap Index File:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemap-posts.xml</loc>
<lastmod>2026-07-21</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-pages.xml</loc>
<lastmod>2026-07-20</lastmod>
</sitemap>
</sitemapindex>Segmentation by content type: Create separate sitemaps for posts, pages, products, categories, and images. This helps Google understand your site structure.
What to Include and Exclude
Include: - Canonical pages with quality content - Pages you want indexed - Pages with unique value
Exclude: - Pagination pages (page/2/, page/3/) - Tag and category archive pages (if thin content) - Search result pages - Admin and login pages - Pages blocked by robots.txt - Pages with noindex tag
Canonical Alignment
The URL in your sitemap must exactly match the page's canonical URL. Any mismatch confuses Google. All variants (http vs https, www vs non-www, trailing slash vs no slash) must be consistent.
Image and Video Sitemaps
For image-heavy or video-heavy sites, create specialized sitemaps with image:image and video:video tags. This helps Google discover media content that might not be found through regular crawling.
Submitting to Search Console
Submit your sitemap URL in Google Search Console > Sitemaps. Google will report: submitted URLs, indexed URLs, errors, and warnings. Monitor this report regularly.
Common Sitemap Mistakes
- Including noindex pages in the sitemap
- Including blocked (robots.txt) pages
- Inaccurate or stale lastmod dates
- Missing sitemap for large sites (10,000+ pages)
- URL mismatches between sitemap and canonical tags
- Not submitting the sitemap to Google Search Console
- Using HTTP instead of HTTPS
