Sitemap Diff

Compare sitemap releases to catch URL changes before launch

3 minute readBy Brownsmith Dynamics

Use a sitemap comparison to spot additions, removals, metadata edits, and duplicates during a site release.

A site release can change its URL inventory in ways that are hard to notice by browsing a few pages. A section may disappear from the sitemap, a new set of pages may appear, or metadata may change across many entries. Comparing the previous and current sitemap gives a concrete review list before a deployment becomes the new baseline.

Sitemap Diff is a Node.js library and command-line tool that parses standard Sitemap 0.9 XML and compares URL collections. Its reports separate added, removed, unchanged, metadata-changed, and duplicate entries. Brownsmith Dynamics makes developer tools for focused tasks; see its main site for more information.

Make a release review concrete

Suppose a team is preparing a redesign of its help center. It can save the production sitemap as the “before” input and generate a sitemap from staging as “after.” The comparison can show that a new troubleshooting guide was added, an old setup page disappeared, and the last-modified value changed for a shared URL. A reviewer now has specific items to check with product and content owners.

The tool matches entries by normalized loc value and detects changes to lastmod, changefreq, and priority. These metadata values are compared as strings. A timestamp written in a different format can therefore register as changed even if a person considers the dates equivalent. Treat the report as a prompt for review, not a judgment about whether a change is correct.

Normalize only what your site considers equivalent

By default, fragments are stripped, so a URL ending in “#section” compares as the same URL without that fragment. Other transformations, such as sorting query parameters, removing selected parameters, lowercasing paths, or stripping a trailing slash, are opt-in. That flexibility matters because some sites treat two paths or query variants as distinct pages. Over-normalizing can merge URLs that your application considers different.

Duplicate normalized URLs are reported separately for each side. If a URL occurs more than once, the first entry is used for comparison and extra entries are surfaced as duplicates. That makes the report useful for detecting sitemap hygiene issues alongside intentional inventory changes.

Choose local parsing or remote loading deliberately

For a controlled release check, comparing local XML files avoids network fetching. The command-line tool accepts UTF-8 XML files, gzip files, or HTTP(S) URLs. The library can also load a sitemap index and follow its child sitemap references within finite limits. It does not crawl ordinary page URLs listed in a urlset; those remain data for comparison.

When you use a remote loading API, the Node.js process makes requests to the supplied sitemap host and any index children. Private and local network addresses are blocked by default, and opting in to them should be reserved for trusted inputs and networks you control. Check limits and errors if a sitemap is unusually large or a request times out.

Sitemap Diff requires Node.js 22 or later and is ESM-only. Review the project source and documentation or install details on npm. A diff is a useful release artifact: it focuses human attention on what changed, while decisions about redirects, page status, and launch readiness remain with your team.