What is XML sitemap?
An XML sitemap is a file listing the URLs you want search engines to crawl and index, optionally with the date each page last changed.
An XML sitemap is a machine-readable list of the URLs on your site that you want search engines to discover. It doesn’t force anything into the index, but it hands crawlers a complete, current inventory instead of leaving them to find every page through links.
The format
Sitemaps follow the sitemaps.org protocol, which Google, Bing and other engines support:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/guides/repotting-orchids</loc>
<lastmod>2026-10-12</lastmod>
</url>
</urlset>
Only <loc> is required. URLs must be absolute, on the same host as the sitemap unless you’ve verified both sites, and XML-escaped — an ampersand in a URL becomes &.
Limits and what Google reads
- Each file holds at most 50,000 URLs and 50 MB uncompressed. Bigger sites split into several files listed in a sitemap index.
- Google uses
lastmodonly when it is consistently accurate, and ignorespriorityandchangefreqaltogether (Google’s sitemap guide). - Extensions exist for images, videos, news articles and hreflang alternates.
Who needs one
Google says sitemaps help most on large sites, new sites with few external links, and sites with lots of media or fast-changing content. A 20-page brochure site with clear navigation gains little — but a sitemap costs nothing to maintain once it’s automated, and Bing also uses it to prioritize crawling.
How to submit it
Add a Sitemap: line to robots.txt, then submit the URL in Google Search Console and Bing Webmaster Tools. Google retired its anonymous sitemap “ping” endpoint in 2023, so pinging no longer does anything. To notify Bing, Yandex and other IndexNow engines instantly, use IndexNow; Google doesn’t support it.
Common mistakes
- Listing URLs that redirect, return 404, carry noindex or canonicalize elsewhere. A sitemap should contain only final, indexable, canonical URLs; every exception teaches search engines to trust the file less.
- Setting
lastmodto today on every build, even when nothing changed. - Forgetting to regenerate after a migration, so the old URL structure lives on.
- Serving the sitemap URL as an HTML error page with a 200 status.
Validate yours
The sitemap validator finds your sitemap via robots.txt or the usual paths, checks the XML and protocol limits, reviews lastmod dates and hreflang alternates, and status-checks a sample of listed URLs for 404s, redirects and noindex. No sitemap yet? The sitemap generator crawls up to 300 pages and builds one. To see where sitemaps fit in discovery, read about indexing.
Frequently asked questions
Does an XML sitemap guarantee indexing?
No. It helps search engines discover and prioritize URLs, but each page still has to be crawlable, indexable and useful enough for Google to keep it.
How often should I update my sitemap?
Whenever pages are added, removed or meaningfully changed. Most CMSs and SEO plugins regenerate the file automatically; just make sure lastmod reflects real content changes.
Can a site have more than one sitemap?
Yes. Many sites split sitemaps by section or content type and list them all in a sitemap index. You can also reference several sitemaps with separate Sitemap lines in robots.txt.