What is a sitemap.xml, and what does it do?
A sitemap.xml is a file at the root of a website that lists its pages, and can carry extra detail about video, image or news content on them. A search engine reads it to find and understand those pages faster than it might by following links alone, and a site built on a common CMS often already has one without anyone adding it by hand.
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/</loc>
<lastmod>2026-11-01</lastmod>
</url>
<url>
<loc>https://example.com/pricing</loc>
<lastmod>2026-10-14</lastmod>
</url>
</urlset><sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemap-posts.xml</loc>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-products.xml</loc>
</sitemap>
</sitemapindex>A plain sitemap lists URLs directly. Once a site outgrows one file's limits, a sitemap index points to several child sitemaps instead.
Does your website need one at all?
Google's own guidance ties the answer to a handful of signals, not to a blanket rule. A sitemap helps most on a site that is hard to fully link, new, or rich in media, and it matters least on a small site that is already well linked.
| If this describes your site | What Google's documentation says |
|---|---|
| Large site, hard to guarantee every page is linked from somewhere | More likely Googlebot misses new pages without a sitemap |
| New site with few external links pointing to it | Crawlers mostly discover pages via links from already-crawled pages, so a sitemap matters more when little else points to you |
| Heavy on video or image content, or shown in Google News | A sitemap can carry extra detail, such as a video's length or an article's date, that Search can use |
| About 500 pages or fewer, and fully linked from the homepage | Google's documentation says the site may not need a sitemap at all |
Source: Google Search Central, Learn about sitemaps
The size limits almost nobody hits
A sitemap has hard ceilings, documented by Google rather than left to guesswork. Most sites never come close to them, but a growing site eventually does, and the fix is a sitemap index file, not a bigger single file.
| Limit | Value |
|---|---|
| URLs in one sitemap file | 50,000 |
| Size of one sitemap file, uncompressed | 50MB |
| <loc> tags in one sitemap index file | 50,000 |
| Sitemap index files you can submit per site in Search Console | 500 |
| "Sitemap:" lines allowed in robots.txt | No limit |
Source: Google Search Central, Build and submit a sitemap; Manage sitemaps with a sitemap index file
Mistakes Google's documentation calls out directly
- Don't put anything other than URLs in the sitemap file.
- List the canonical URL when the same content sits at more than one address, not every duplicate that leads to it.
- Use fully-qualified, absolute URLs. Google attempts to crawl a sitemap's URLs exactly as listed, so a relative path will not resolve.
- A sitemap not submitted through Search Console only affects URLs under its own folder; posting it at the site root, which Google recommends, covers the whole site instead.
Having a sitemap is not the same as being indexed
A sitemap is a hint, not a command. Google's own documentation states plainly that a sitemap "helps search engines discover URLs on your site, but it doesn't guarantee that all the items in your sitemap will be crawled and indexed." The file only does its job if what it lists is accurate.
Sitemap lists URLs no visitor can reach anymore
How to check your own sitemap right now
- Open yoursite.com/sitemap.xml directly and confirm it loads and lists real URLs, not a 404 or an empty stub.
- Open yoursite.com/robots.txt and look for a "Sitemap:" line pointing at it.
- If the file is a sitemap index, open a couple of the child sitemaps it references and confirm they resolve too.
- Submit the sitemap, or the sitemap index, in Search Console's Sitemaps report so you can see Google's own read of it.
- Re-check it after changes: Auditaar reads sitemap staleness, duplicate URLs and low-value URL patterns on every audit, not just whether the file exists.
Run a free AI visibility check to see how Auditaar reads your own sitemap's staleness, duplicates and structure, or read how to read a website audit for how that fits into the six pillars.