Old URLs from before a catalog migration remain in the sitemap. Each one leads to a new page, so users do not see any errors. The sitemap still lists the intermediate URLs. Find the final page for each old URL. If it is a suitable replacement, add its URL to the sitemap; if the page was deleted without a replacement, remove the entry.
List the URLs in the loc tags
Google recommends listing preferred canonical URLs in a sitemap. Official documentation.
Start by saving the original sitemap and the time you retrieved it. XML may be generated dynamically, so exporting it again after the catalog changes will produce a different set of URLs. Copy the URL from each loc tag without manually removing parameters or normalizing slashes. For a large list, limit the number of concurrent requests and save the complete result for each URL. Record the old URL, every redirect, and the final URL. Note what changed alongside it: only HTTP to HTTPS, or the path of the service itself. This will help you fix the source of the links in the CMS.
What to replace the old URLs with
| URL in sitemap | What happened to it | What to add to the sitemap | What to check after the change |
|---|---|---|---|
| /old-service/ | 301 to /service/ | Replace the entry | Check the destination service |
| /a/ → /b/ → /c/ | Two redirects | Add /c/ | Check that it is the right destination |
| /removed/ | 404 with no equivalent | Exclude it | Do not substitute the homepage |
| /service/ | 200, canonical points to this same URL | Keep it | No noindex |
Preserve every Location header in the chain
Ask the developer to check a regular page request (GET), saving the response headers for each redirect. In curl, the -L flag follows redirects, while -D saves the received header blocks; without -L, you can see the initial response. During diagnosis, compare both modes and specify the final URL. The -I option uses HEAD, which retrieves headers only, without the content; some servers handle it differently. To confirm how a regular document behaves, it is preferable to check with GET. Do not set the redirect limit too high just to hide a loop. If a URL repeats, stop the check and record the chain issue separately from the sitemap cleanup.
For the selected old URL, the developer can run this in the terminal:
curl -sS -L --max-redirs 10 -D headers.txt -o response.html 'https://example.com/old-service/'Because of -L, headers.txt will contain the headers for all redirects, while response.html will contain the final page. If the first line shows 301/308, find the redirect URL in Location and check where the old loc leads. Add the suitable final URL to the new sitemap. Replace example.com with your domain; this GET request does not change the site settings. curl documentation.
Check the destination page
At the final URL, check more than just 200. It could be an error page, a login page, or a generic placeholder. Compare the tab title, the main heading (H1), and the body text with the expected page, then check the canonical and noindex. If the canonical points to another URL, find out which URL is actually selected. A page reached after a redirect but intentionally excluded from indexing should not be included in the new list just because it loads successfully. Separately check that a guest can access the destination and that it has ordinary links to it from the public navigation.
Fix the URL source in the CMS
Find out where the generator gets the old loc values: a field containing part of the page address (slug), a routing table, an imported absolute URL, or the base domain in the content management system (CMS). Manually editing the published XML often gets overwritten the next time it is regenerated. Fix the source and run the standard sitemap generation process again. If the plugin has separate settings for content types, make sure changing the URL did not disable the section you need. After publishing, check the public file, not just the generator's saved output. If there is a sitemap index, also check the updated child sitemap and its link in the index.
Keep redirects for old links
Removing an old URL from the sitemap does not mean you should remove its redirect. External links, bookmarks, and visitors' history may still use the old address. Keep the necessary server rules and update new internal links to use the final URL. A redirect serves the old bookmark, while new menus and cards should open the final page directly. Check the menus, breadcrumbs, and cards in the relevant section. If the URL contains a filter or language, open the new address directly and make sure they have been preserved.
Check the new sitemap after regeneration
The old service URL has been replaced with an accessible final URL that does not require an extra redirect. A deleted URL with no replacement is absent. Old bookmarks still open suitable pages through redirects; new menus and the sitemap link to them directly.
Read also: Sitemap.xml errors: how to find and fix them and How to use reChecker to analyze redirects. Site checks are available on the reChecker technical audit page.