XML sitemaps · Sitemap URLs
Redirecting URL in sitemap
The XML sitemap lists an old address for this page that now 301 redirects here. Sitemaps should list only the final destination URL.
How this page is built
/sitemap.xml lists this page and also /tests/redirecting-url-in-sitemap/old/. A rule in _redirects sends that old address here with a 301 redirect. Nothing on the site links to the old address, so the sitemap is the only place it appears.
Why it matters
Search engines treat sitemap URLs as the addresses you want indexed. A redirecting URL asks them to index an address you have moved away from, and every visit costs an extra request before they reach the real page.
Google also uses sitemaps as a hint for choosing canonicals. Listing the old address works against the redirect and can slow down the move to the new one.
How to check it
Crawl the URLs in the sitemap and look for any 3XX status code. Crawl tools list sitemap URLs that redirect, and Search Console’s page indexing report shows them as “Page with redirect”.
How to fix it
Replace each redirecting URL in the sitemap with its final destination. When pages move, update the sitemap at the same time as adding the redirect, or generate it from the current page addresses.