XML Sitemap vs Sitemap Index and How to Check Both
What Is the Difference Between an XML Sitemap and a Sitemap Index?
An XML sitemap lists individual page URLs that a website wants search engines to discover. A sitemap index lists the locations of multiple sitemap files instead of listing the pages themselves. Both use XML, but they organize different levels of information. To check them, identify the file’s root element, confirm it loads correctly, inspect its entries, and review Google’s processing status in Search Console.
Why Websites Have Both Types of Sitemap
Imagine a website with hundreds of blog posts, product pages, categories, and landing pages. Its XML sitemap tells search engines where those pages are. If the site separates those URLs into several files, its sitemap index acts like a directory pointing to each file.
A sitemap index does not replace the child sitemaps. It helps search engines find them from one entry point. A small website may need only one XML sitemap; a larger WordPress or ecommerce website may use an index even when it is nowhere near Google’s technical size limits.
The important distinction: a sitemap index containing five sitemap links is not a sitemap containing five pages. Those five files may contain hundreds or thousands of page URLs.
XML Sitemap vs Sitemap Index at a Glance
| Feature | XML sitemap | Sitemap index |
|---|---|---|
| Main purpose | Lists individual page or content URLs | Lists individual sitemap files |
| XML root element | <urlset> |
<sitemapindex> |
| Entry element | <url> |
<sitemap> |
Meaning of <loc> |
Address of a page or other supported content URL | Address of a child sitemap file |
| Common filenames | post-sitemap.xml, sitemap.xml |
sitemap_index.xml, wp-sitemap.xml |
| Main check | Inspect page URLs, crawlability, canonicals, and XML validity | Inspect child sitemap links, accessibility, and XML validity |
Filenames are conventions, not a reliable technical test. A file named sitemap.xml can contain a sitemap index. Inspect the root XML element to know which type you are looking at.
How to Recognize Each File in Its XML Code
Example 1: A regular XML sitemap
This file lists two pages. Each <loc> points to a URL on the website:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/</loc>
</url>
<url>
<loc>https://example.com/blog/</loc>
</url>
</urlset>
Example 2: A sitemap index
This file lists two other XML sitemap files. It does not directly list the homepage or blog pages:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/post-sitemap.xml</loc>
</sitemap>
<sitemap>
<loc>https://example.com/page-sitemap.xml</loc>
</sitemap>
</sitemapindex>
Both examples use the standard sitemap namespace. The optional <lastmod> element can communicate a meaningful last modification date, but it has a different subject: a page in a regular sitemap and a sitemap file in an index. Google says page modification dates should be accurate and reflect significant changes, not routine timestamp updates.
How to Find an XML Sitemap or Sitemap Index on Any Website
- Open the site’s robots.txt file. Try
https://example.com/robots.txtand look for a line starting withSitemap:. It may reveal the site’s preferred sitemap location. - Try common paths. Check
/sitemap.xml,/sitemap_index.xml, and/wp-sitemap.xml. These are possibilities, not guaranteed URLs. - Look in the SEO plugin settings. WordPress sitemap plugins often provide a direct link to the generated sitemap.
- Check the XML root element. Look for
<urlset>or<sitemapindex>instead of relying on the file name or visual formatting. - Follow the child links. If the first file is a sitemap index, open at least one child sitemap and verify that it lists real URLs.
A browser may display a message saying that an XML file has no associated style information. That message alone does not indicate a sitemap error; it often means there is no stylesheet for presenting the XML visually.
How to Check Both Files Without Confusing Their Results
Step 1: Confirm that the server serves the file
Open the sitemap URL and inspect its HTTP response when possible. A successful public response is normally 200 OK. A 404 means the requested file cannot be found; a 403 may indicate an access restriction; and a 5xx status may indicate a server problem. Also confirm that a login page, security challenge, or ordinary HTML error page is not being returned in place of XML.
Step 2: Validate the XML structure
Check that the document is well-formed XML, uses the correct sitemap namespace, and contains the required elements. In a regular sitemap, each <url> requires a <loc>. In an index, each <sitemap> requires a <loc> pointing to a sitemap file.
A common failure is an unescaped ampersand inside a URL. For example, a query-string separator must be written as & in XML text rather than a raw ampersand. Use the XML Sitemap Validator to help review sitemap markup, subject to checking the tool page’s availability on your site.
Step 3: Inspect the sitemap index’s child links
Open every child sitemap listed in the index, not just the first one. Confirm that each link is a complete URL, returns the intended XML file, and does not lead to a missing page or a second sitemap index. Google does not allow nested sitemap indexes. For normal configurations, child sitemaps must also meet Google’s applicable site and directory-location rules; cross-site submission requires a specifically configured exception.
Step 4: Check actual URLs inside each XML sitemap
Inspect the page entries in the child sitemaps. Focus on URLs that are important, indexable, canonical, and return appropriate responses. Watch for deleted posts, redirected addresses, accidental noindex pages, duplicate URL variants, and outdated HTTP links on an HTTPS website.
A sitemap is a discovery signal, not a command to index everything. A URL can be listed correctly yet remain unindexed because of page quality, duplication, crawl issues, or other indexing considerations.
Step 5: Compare counts at the correct level
Count <sitemap> elements to find the number of child sitemap references in an index. Count <url> elements to find the page URL entries within an individual XML sitemap. To estimate the total page URLs represented by an index, check all child files and account for duplicate URLs.
For a migration or a large content audit, a Sitemap Comparison Tool can help you compare two sets of sitemap URLs after confirming the input format supported by the tool.
How to Check a Sitemap Index in Google Search Console
- Open the correct website property in Google Search Console.
- Choose Indexing > Sitemaps.
- Submit the sitemap index URL, or the individual XML sitemap URL if the site does not use an index.
- Review the file’s Type, Last read, Status, and Discovered pages fields.
- Open any error details and investigate the particular sitemap or affected page URLs.
- Use the Page indexing report and URL Inspection for individual URLs when you need to distinguish discovery from actual indexing.
Search Console identifies sitemap types separately. A successful status means Google could retrieve and process the submitted sitemap; it does not mean that every URL has been indexed. For a sitemap index, the Discovered pages figure covers page URLs parsed from its child sitemaps, with duplicate URLs counted once.
Another detail matters: the Sitemaps report primarily lists sitemaps submitted through the report or the Search Console API. A sitemap discovered only through robots.txt may still be used by Google without appearing in your submission list.
Sitemap Size Limits and When an Index Becomes Useful
Under Google’s sitemap requirements, one regular sitemap must contain no more than 50,000 URLs and must not exceed 50 MB uncompressed. A sitemap index can list up to 50,000 sitemap files. When a sitemap reaches a limit, split its URLs into multiple valid files and reference those files from an index.
These are maximums, not ideal target sizes. A WordPress SEO plugin may deliberately create much smaller sitemap files to simplify maintenance. A sitemap index can be useful long before a website reaches 50,000 pages.
Do not interpret a large sitemap as proof of SEO success. The useful measure is whether it exposes the site’s intended canonical URLs and whether search engines can access and process them.
Which Sitemap Should You Check on WordPress?
WordPress core has included XML sitemap support since WordPress 5.5. Its default index path is generally /wp-sitemap.xml. SEO plugins may provide their own sitemap system instead. For example, Rank Math commonly uses /sitemap_index.xml; other plugins may use a similar address.
If more than one sitemap system is active, check which one your SEO plugin intends to manage and which URL is submitted in Search Console. Do not automatically assume that two discoverable sitemap URLs mean both should be submitted. The goal is a consistent, up-to-date set of canonical URLs without unnecessary overlap or conflicting coverage.
If a sitemap starts returning a 404 after a WordPress plugin change, check the plugin’s sitemap settings, WordPress permalink settings, and server rewrite configuration before creating a static replacement file. A sitemap can be generated dynamically even though its URL ends in .xml.
Common XML Sitemap and Sitemap Index Problems
| Problem | Likely issue | What to check |
|---|---|---|
| Sitemap could not be fetched | Incorrect URL, access block, or server problem | Response status, robots.txt, firewall rules, and server logs |
| XML parsing error | Malformed tags, wrong namespace, or unescaped characters | XML validator output and the reported line |
| Index loads but child sitemaps fail | Broken links or missing generated files | Every <sitemap> location separately |
| Nested sitemap index error | An index points to another index | Replace the nested reference with actual sitemap files |
| Missing new posts | Excluded post type, caching, or sitemap configuration | SEO plugin inclusion rules and fresh child sitemap output |
| Submitted URLs are not indexed | Indexability or content-level issues | Canonical tags, noindex rules, responses, and Page indexing report |
| More than one sitemap is visible | WordPress core and plugin both expose sitemap endpoints | Which system is authoritative and submitted |
If you need to review URLs at scale, use a Sitemap URL Extractor to prepare a list for checks, after verifying that it supports your sitemap’s format. For sitemap discovery rules, the Robots.txt Generator and Tester is another relevant companion tool.
Frequently Asked Questions
Is a sitemap index the same as an XML sitemap?
No. Both use XML, but an XML sitemap lists page URLs while a sitemap index lists sitemap file URLs. The root elements are <urlset> and <sitemapindex>, respectively.
Should I submit sitemap.xml or sitemap_index.xml to Google?
Submit the actual sitemap URL your website generates. If it is an index, submitting that index is usually the simplest way to make all its child sitemaps available to Google. Do not guess the correct file based only on its filename.
Can I submit both an index and its child sitemaps?
Yes. Google supports submissions of individual sitemaps and sitemap indexes. However, submitting both is not generally necessary for discovery if the index already includes the child files. Separate submissions may be useful for focused monitoring.
Does a successful sitemap status mean all my pages are indexed?
No. Success confirms sitemap processing, not indexing of every discovered URL. Check Google’s Page indexing report and inspect representative URLs to understand which pages are indexed.
How often should I check my sitemap?
Check after major launches, migrations, permalink changes, SEO plugin changes, or a sudden drop in discovered URLs. For an actively updated site, review Search Console regularly and investigate alerts rather than repeatedly resubmitting an unchanged sitemap.
A Simple Final Checklist for Both Files
- The submitted sitemap URL is correct and publicly accessible.
- The XML root element identifies the intended type.
- Every child sitemap listed in an index opens successfully.
- Child files contain intended, absolute, canonical page URLs.
- The XML syntax, namespaces, and file sizes meet the requirements.
- Google Search Console shows the expected processing status.
- Indexing decisions are checked separately from sitemap discovery.
Bottom line: check a sitemap index for the health of its file links, then check each XML sitemap for the quality and accessibility of its page URLs. Both checks are necessary to understand whether your sitemap setup is genuinely useful to search engines.