What Is an XML Sitemap? How It Helps Search Engines Crawl Your Site
An XML sitemap is a file, typically named sitemap.xml, that lists the URLs of a site along with optional metadata like last modification date — helping search engines discover pages, especially ones that might otherwise be hard to find through normal link-following. Google's documentation is clear that a sitemap is a hint about which pages exist and their relative structure, not a guarantee that every listed URL will be crawled or indexed.
Definition
An XML sitemap follows the sitemaps.org protocol, a format supported by all major search engines, listing each URL a site wants search engines to know about. It's especially useful for large sites, new sites with few external links, sites with pages not well-linked internally, or sites with rich media/video content not easily discoverable by crawling alone. Established
Basic Format
<?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-09-05</lastmod>
</url>
</urlset>
The <loc> tag is required and specifies the full URL. <lastmod> is optional but recommended, indicating when the page was last significantly modified — Google's documentation notes this value should be accurate, since a sitemap with consistently incorrect lastmod dates may cause the field to be disregarded. Established
A Hint, Not a Crawl Guarantee
Submitting a sitemap does not guarantee every listed URL will be crawled or indexed. Google's documentation states plainly that a sitemap tells Google which pages the site owner considers important, but crawling and indexing decisions still depend on the usual factors — content quality, crawl budget, and technical accessibility of each page. Established
Submitting a Sitemap
- Reference it in robots.txt with a
Sitemap:directive, which most crawlers check automatically. - Submit directly via Google Search Console and Bing Webmaster Tools, which also provide indexing status feedback per URL.
- Split large sitemaps. The sitemap protocol caps a single file at 50,000 URLs or 50MB uncompressed; larger sites use a sitemap index file referencing multiple child sitemaps.
Common Mistakes
- Including non-canonical, redirecting, or noindexed URLs. A sitemap should list only the canonical, indexable version of each page.
- Letting lastmod dates go stale or become inaccurate. Google's guidance warns that consistently wrong lastmod values may cause the signal to be ignored entirely.
- Assuming sitemap submission alone drives indexing. It aids discovery, but crawling and indexing decisions still depend on normal quality and accessibility factors.
- Forgetting to update the sitemap when new pages launch. A stale sitemap misses newly published content that search engines would otherwise discover faster through it.
FAQ
Does a sitemap guarantee my pages get indexed?
No. A sitemap helps search engines discover URLs, but indexing still depends on content quality, technical accessibility, and other normal ranking-adjacent factors.
Is lastmod required in a sitemap?
No, but it's recommended. Google's documentation notes the value should be accurate, since consistently incorrect dates can cause the field to be disregarded.
How many URLs can one sitemap file contain?
Up to 50,000 URLs or 50MB uncompressed per the sitemap protocol. Larger sites split URLs across multiple sitemap files referenced by a sitemap index.
Related Concepts
Sources
- Google Search Central. "Build and Submit a Sitemap." developers.google.com
- sitemaps.org. "Sitemaps XML Format." sitemaps.org