XML Sitemaps: Structure, Limits, and Common Mistakes
- Filed November 10, 2026
- Crawling and indexing, guide 16 of 16
An XML sitemap is a list of URLs you want search engines to know about, with optional details such as when each page last changed. It helps discovery; Google’s sitemap overview names the cases where one is most useful: large sites, new sites with few external links, and sites with a lot of rich media or content shown in Google News (Google’s sitemaps overview). It does not guarantee crawling or indexing: Google’s documentation calls submitting a sitemap “merely a hint” that does not guarantee Google will download it or use it for crawling (Google’s guide to building a sitemap). A good sitemap is accurate, current and limited to URLs you actually want in search results.
The minimum valid structure
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.com/guides/xml-sitemaps/</loc>
<lastmod>2026-11-02</lastmod>
</url>
</urlset>
Only <urlset>, <url> and <loc> are required by the protocol. <lastmod> is optional but useful when accurate.
Limits and format rules
Google’s documentation sets these rules:
| Rule | Value |
|---|---|
| Maximum size of one sitemap | 50 MB uncompressed or 50,000 URLs |
| Encoding | UTF-8 |
| URL format | Fully qualified, absolute URLs |
| Scope by location | A sitemap affects only descendants of its directory, unless submitted through Search Console |
| Sitemap index capacity | Up to 50,000 <!–INLINECODE4–> tags per index file |
| Index files per site in Search Console | Up to 500 |
| Location of referenced sitemaps | Same site as the index file, unless cross-site submission is set up |
Sources: Google’s guides to building a sitemap and to sitemap index files.
What Google uses and ignores
<loc>: the URL itself. Use the canonical version of each URL.<lastmod>: Google uses it “if it’s consistently and verifiably” accurate, for example when it matches the last modification of the page. Google’s guidance explains that a change to the main content, structured data or links is generally a significant update, while a change to the copyright date is not.<priority>and<changefreq>: Google states it ignores both. Leaving them out changes nothing for Google; filling them in carefully changes nothing either.
Which URLs belong in a sitemap
Include URLs that are:
- the canonical version (not a duplicate pointing elsewhere with
rel="canonical"); - indexable (no
noindex, not blocked by robots.txt); - returning 200, not redirecting and not returning an error;
- pages you want to appear in search.
Leave out:
- redirecting URLs (list the destination instead);
- URLs with
noindex; - parameter and session variants;
- error pages and soft 404s;
- pages blocked by robots.txt (Google cannot crawl them, so listing them sends contradictory signals).
Google’s guide notes that it “generally shows the canonical URLs in its search results, which you can influence with sitemaps”. Listing duplicates muddies that signal.
Sitemap index files
Large sites split URLs across several sitemaps and list them in a sitemap index:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://www.example.com/sitemaps/products-1.xml</loc>
<lastmod>2026-11-05</lastmod>
</sitemap>
<sitemap>
<loc>https://www.example.com/sitemaps/articles.xml</loc>
</sitemap>
</sitemapindex>
Splitting by content type (products, categories, articles) also has a diagnostic benefit. Google notes that separate sitemaps can be useful to track the search performance of each one in Search Console, so indexing problems in one section stand out.
Specialized sitemap formats (image, video and news) extend the same structure. Video sitemaps have their own required tags and are a separate topic.
How to make Google aware of a sitemap
- Submit it in Search Console in the Sitemaps report. This also gives you processing status and errors.
- Reference it in robots.txt with a
sitemap:line containing the full URL.
Submitting a sitemap does not make Google crawl faster or index more. It tells Google where the list is.
A validation checklist
File
- [ ] Returns HTTP 200 and is served as XML (or gzip if compressed).
- [ ] Parses as valid XML with the correct namespace.
- [ ] UTF-8 encoded; special characters such as
&escaped as&. - [ ] Under 50 MB uncompressed and 50,000 URLs.
URLs
- [ ] Absolute URLs on the correct protocol and host (
https://www.vshttps://). - [ ] Every URL returns 200 when requested directly.
- [ ] Every URL is self-canonical.
- [ ] No URL carries
noindexor is disallowed in robots.txt.
Dates
- [ ]
lastmodreflects real content changes, not the time the sitemap was generated. - [ ] Date format follows W3C Datetime (for example
2026-11-02or2026-11-02T14:30:00+00:00).
Reporting
- [ ] The Sitemaps report shows “Success” and a discovered URL count close to the expected count.
- [ ] Page indexing report filtered to the sitemap shows the indexed share of submitted URLs.
Valid and invalid entries
| Entry | Valid? | Why |
|---|---|---|
| <!–INLINECODE21–> | Yes | Absolute, canonical |
| <!–INLINECODE22–> | No | Relative URL |
| <!–INLINECODE23–> on an https www site | Problematic | Wrong protocol and host; redirects |
| <!–INLINECODE24–> | Problematic | Parameter variant, not canonical |
| <!–INLINECODE25–> | No | Unescaped ampersand breaks XML |
| <!–INLINECODE26–> on every URL every day | Problematic | Not verifiably accurate, so Google may ignore it |
Common mistakes
- Treating a sitemap as an indexing request. It is a discovery hint. Pages still need to be worth indexing.
- Automatic lastmod on every regeneration. If every date changes daily, the field carries no information.
- Listing redirected and noindexed URLs. Plugins can include URLs that the same site tells Google not to index.
- Forgetting the index-to-sitemap relationship. Child sitemaps must be on the same site as the index, unless cross-site submission is configured.
- Leaving a staging host in
<loc>values after a launch or migration. - Relying on the sitemap instead of internal links. A sitemap tells Google a URL exists; internal links tell readers and Google how pages relate. Pages that appear only in the sitemap are orphans in the site’s structure.
Reading sitemap errors in Search Console
The Sitemaps report shows whether Google could fetch and parse each sitemap. Statuses include success, “Couldn’t fetch” (network or access problem) and parsing errors. A successful sitemap with many URLs not indexed is not a sitemap error; the URLs were discovered and then judged by indexing systems. Use the Page indexing report, filtered to the sitemap, to see why.
Sitemaps for a 123,800-URL store
A hypothetical store has 120,000 product URLs, 3,000 category URLs and 800 articles.
- Structure: three product sitemaps of 40,000 URLs, one category sitemap, one article sitemap, all listed in
sitemap-index.xml. - Content rules: only product pages that are live and indexable, whether in stock or temporarily out of stock; discontinued products that redirect are removed from the sitemap.
- Dates:
lastmodset from the product database’s last content change (price, description, availability), not from the cache timestamp. - Submission: index submitted in Search Console;
sitemap:line in robots.txt. - Check: confirm that each child sitemap reports success, then filter the Page indexing report by sitemap to see which section has the lowest indexed share; that section is the next investigation.
A sitemap is a maintenance artifact. Generated correctly and kept in sync with what the site wants indexed, it is a reliable discovery aid; left to drift, it becomes a list of contradictions.