In this article
What Is an XML Sitemap?
An XML sitemap is a file that lists the important URLs on your website, helping search engines like Google, Bing, and others discover and crawl your pages efficiently. It acts as a roadmap for search engine bots, providing metadata about each URL such as when it was last updated, how often it changes, and its relative priority.
Sitemaps follow the Sitemap Protocol (sitemaps.org), an open standard supported by all major search engines. While search engines can discover pages through links, a sitemap ensures that even pages with few inbound links are found and indexed promptly.
How XML Sitemaps Work
A sitemap is a structured XML document that provides search engines with a complete inventory of crawlable pages on your site.
- URL entries — each <url> element contains a <loc> tag with the full page URL, plus optional <lastmod>, <changefreq>, and <priority> tags
- Sitemap index — for large sites exceeding 50,000 URLs or 50MB, multiple sitemaps are linked via a <sitemapindex> file
- Submission — sitemaps can be submitted to search engines via Google Search Console, Bing Webmaster Tools, or referenced in robots.txt
Try it free — no signup required
Generate Your Sitemap →When To Use a Sitemap Generator
Sitemaps are valuable for any website, but they are especially critical in certain scenarios.
- New website launches — ensure search engines discover all pages from day one instead of waiting for natural crawl discovery
- Large sites with deep pages — pages buried 4+ clicks from the homepage may never be crawled without sitemap inclusion
- Multilingual sites — use hreflang annotations within sitemaps to help search engines serve the correct language version to users
Frequently Asked Questions
What are the size limits for a sitemap?
A single sitemap file can contain a maximum of 50,000 URLs and must not exceed 50MB when uncompressed. For larger sites, use a sitemap index file that references multiple sitemap files. There is no limit to the number of sitemap index files you can have.
How often should I update my sitemap?
Update your sitemap whenever you add, remove, or significantly modify pages. For dynamic sites with frequent content changes, automate sitemap generation as part of your build or deployment pipeline. The <lastmod> date should reflect actual content changes, not arbitrary timestamps.
What is the difference between a sitemap and robots.txt?
They serve opposite purposes. Robots.txt tells search engines which pages NOT to crawl, while a sitemap tells them which pages TO crawl. They work together: robots.txt can include a Sitemap directive pointing to your sitemap URL, combining access control with page discovery.