---
name: check-a-sitemap-inventory
description: "Audit an XML sitemap or sitemap index entry by entry for relative URLs, URLs outside the sitemap's scope, duplicates and lastmod dates that do not match real page changes. Use when someone asks to check, audit or clean up a sitemap.xml before submitting it to search engines."
license: CC-BY-4.0
metadata:
  author: Raq.com
  version: "2026-11-22"
  homepage: https://skills.raq.com/skills/check-a-sitemap-inventory
---

# Check an XML sitemap inventory

Review listed URLs for scope errors and misleading modification dates using an offline sitemap and content-change records.

## When to use this skill

- Someone has a sitemap.xml or sitemap index and wants to know which entries are wrong before submitting it to Google Search Console or Bing Webmaster Tools.
- A CMS rewrites lastmod on every build and the team wants to know which dates are misleading.
- After a migration, someone wants the new sitemaps checked against the pages that should be listed.

## When not to use it

- Predicting whether or when pages will be indexed or ranked. A valid sitemap is a hint; search engines decide what to crawl and index.
- Choosing which URL of a duplicate group should be listed. Use the canonical signals or redirect map skills first, then list only the chosen URLs.
- Image, video or news sitemap extensions, which have their own tags and rules beyond this check.

## What you need

- Sitemap location and XML, or extracted loc and lastmod rows.
- Confirmed modification dates for the listed pages and any verified cross-host submission arrangement.

## Ask before you start

If any of these are missing or unclear, ask before doing the work.

- What is the exact URL of the sitemap file? Its scheme, host and directory decide which URLs it may list.
- Is it a sitemap index? If so, can you supply every child sitemap, decompressed if gzipped? Missing children leave coverage unknown.
- Do you have records of when each page's content last changed in a meaningful way? Without them, lastmod can be checked only for format, not accuracy.
- Is the sitemap submitted through Search Console, or referenced from robots.txt on another host? Either can widen the URLs it may cover.

## Method

1. Identify the file type from its root element. In a sitemapindex, each loc names a child sitemap and its lastmod dates that file, not any page. Build the page inventory only from urlset files you actually have, in index order, decompressing .gz files. List any child you could not read as unavailable and say coverage is incomplete.
2. Check the protocol limits: no more than 50,000 URLs and 50MB (52,428,800 bytes) uncompressed per file, UTF-8 encoding, and each loc under 2,048 characters.
3. Decode XML entities once (&amp; becomes &) and take each loc as written. Flag a loc without a scheme and host as relative-url.
4. Check the scope of each absolute URL: same scheme and host as the sitemap file, and a path inside the sitemap's directory. A sitemap at /catalog/sitemap.xml may list /catalog/ pages but not /help/ pages. Accept a URL outside that scope only with a verified arrangement, such as Search Console verification of both properties or a robots.txt Sitemap line on the other host.
5. Group entries by exact decoded URL and flag the second and later copies as duplicate. Keep differences in path case, trailing slash and query string as distinct URLs unless the site confirms they are the same page.
6. Compare each supplied lastmod with the date the page's content last changed meaningfully. Flag a date that contradicts the record, such as a build timestamp later than the last real change. An omitted lastmod is valid; an unknown change date leaves accuracy unchecked.
7. Report issues by entry number in source order, numbering entries across child sitemaps in index order, and list codes for the same entry in the order relative-url, outside-scope, duplicate, wrong-lastmod. Keep protocol problems separate from views about which pages should be indexed.

## Checks before you deliver

- An escaped ampersand is normal XML and should become a single ampersand in the URL.
- Cross-host hosting and ownership need specific arrangements. Do not treat an arbitrary second hostname as in scope.
- A lastmod set to the generation time on every entry is wrong for every page that did not change. Google says it uses lastmod only when it is consistently and verifiably accurate.
- Reading a sitemap index's lastmod values as page dates confuses file dates with page dates.
- Collapsing URLs that differ only by case or query string can hide genuinely different pages. Report them as listed and ask.
- Google ignores priority and changefreq. Do not spend the review tuning them.

## How to present the result

Start with the totals: entries read, child sitemaps unavailable and issues by type. Then list each issue with its entry number, URL and fix: make it absolute, move it to a sitemap whose directory covers it, remove the duplicate, or correct or drop the lastmod. If asked, give the corrected entries ready to paste, and state what coverage is still unknown.

## Worked example

**Request:** Review https://shop.example/catalog/sitemap.xml. No cross-site arrangement. Treat the following rows as decoded loc|lastmod|actual page change.

**Supplied material:**

```text
https://shop.example/catalog/coat|2026-11-20|2026-10-12
https://shop.example/help/returns|-|unknown
https://shop.example/catalog/coat|-|2026-10-12
```

**Answer:** Keep one entry for /catalog/coat and change its lastmod to 2026-10-12, the recorded page change, or omit the date. Remove the repeated coat entry. List /help/returns in a sitemap whose directory covers /help/.

## Structured output for tests

For an ordinary job, answer in the format above and point back to the supplied evidence. Use this structure only for the test cases published with this skill, or when someone asks for structured JSON.

Return issues as objects with row (one-based URL entry) and code, in source order. Codes in priority order per row are relative-url, outside-scope, duplicate and wrong-lastmod. Apply scope checks only to absolute URLs. Flag duplicates from the second occurrence onward. For multiple child sitemaps, number URL entries consecutively in index order. Include unavailable_sitemaps as an array of absolute child URLs only when child content is missing.

## Sources

- [Sitemaps XML protocol](https://www.sitemaps.org/protocol.html): Defines urlset and sitemapindex files, the 50,000 URL and 50MB uncompressed limits, UTF-8 and entity escaping, a loc under 2,048 characters, lastmod as the page's modification date rather than the generation date, and the rule that a sitemap may list only URLs on its own host and under its own directory.
- [Google Search Central: build and submit a sitemap](https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap): Google says it ignores priority and changefreq, uses lastmod only when it is consistently and verifiably accurate, and that a sitemap affects only descendants of its directory unless submitted through Search Console, where sitemaps can cover several verified sites.

Test cases and an answer checker for this skill: https://skills.raq.com/skills/check-a-sitemap-inventory
