Skip to content

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

  1. Read the files separately and retain original values.
  2. Count unique absolute URLs and list those listed in more than one sitemap.
  3. 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.

Seven sitemap rows cover five pages
GroupUnique URLsRows contributed
Main file only22
Shop file only11
Occurs in both files24

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.

Discuss this workflow with Shadyy

Sources