Count unique URLs when the same page appears in two sitemaps
Combine sitemap rows with the source filename attached. Group by exact absolute URL and compare the raw row count with the distinct URL count. Keep conflicting metadata visible for the site owner.
What you need
For a site owner whose sitemap counts change when multiple tools publish the same pages.
- Declared sitemap files and their URL and last-modified entries.
- The approved canonical host and an owner for each sitemap producer.
Reconcile raw sitemap rows to the unique URLs they contain
- Read the files separately and retain original values.
- Count unique absolute URLs and list those listed in more than one sitemap.
- Review conflicting dates and unexpected hosts. Keep canonical checks separate from counting.
Seven sitemap rows cover five pages
Synthetic data. The two files use the same production host.
Scroll the table to see all columns.
| Group | Unique URLs | Rows contributed |
|---|---|---|
| Main file only | 2 | 2 |
| Shop file only | 1 | 1 |
| Occurs in both files | 2 | 4 |
The files have 7 rows and 5 distinct URLs. Review the two repeated URLs if the files disagree about them.
What to hand over
Give the site owner a URL-level inventory with source memberships and the records needing a decision.
Limitation. A duplicate sitemap record alone does not diagnose a search ranking or indexing issue.
Next step
Bring the sitemap index and examples from files that appear to count the same pages.
Related guides
Sources
- Google’s sitemap creation and submission guide (accessed 23 November 2026)
- Google’s canonical URL guidance (accessed 23 November 2026)