Your sitemap is still sending Google to the old URLs
Weeks after the restructure, the sitemap still listed every old address, served from a cache. How sitemaps go stale and the checks after any URL change.
Weeks after a store’s URL restructure, with every old address redirecting cleanly, the search console was still reporting a long list of redirected pages discovered via the sitemap. The sitemap was the problem. It had been generated once, cached, and served from that cache ever since. Every URL in it was an old one. Google was being told, daily, that the pages that mattered were the ones that no longer existed.
How sitemaps go stale
Almost every platform caches its sitemap, because building one from a large catalogue is slow. The cache is cleared on a schedule, or by a button, or by a cron job somebody turned off two years ago when the server was struggling. A migration changes thousands of URLs in an afternoon. The sitemap keeps describing the site from that morning. Chasing redirects wastes crawl budget and delays the new URLs being indexed by weeks.
The second failure is the sitemap naming the wrong host. Multi-store setups, staging copies and sites behind a proxy will cheerfully produce a sitemap full of internal hostnames or the staging domain, and submit it as the live site.
After any change to URLs
- Regenerate, then read it from outside. Every sitemap, for every store view and language, with whatever cache sits in front of it cleared. Then fetch the public URL through the real hostname and read it. Not the file on disk, not the admin preview. What Google fetches.
- Check that every URL returns 200. A sitemap listing redirects or 404s is worse than none. A one-line script does this in minutes for tens of thousands of URLs.
- Check that nothing is in it that should not be. Pages marked noindex, filter and search result URLs, products hidden from the catalogue, the staging copy of anything. A sitemap is a list of pages you want ranked, not a list of every URL the platform can produce.
- Resubmit and watch. Resubmit in the search console and watch the discovered-via-sitemap reports for a fortnight. The redirected count should fall to zero.
Keep it that way
Sitemap regeneration goes into the runbook as a step immediately after any URL work, with the external fetch as its check. On platforms with a sitemap cron, confirm the cron is running and writes for the real host. On sites with a plugin, test that publishing a page actually clears the sitemap cache, because at least one popular plugin only does so when its file-system write succeeds, and in some server setups it fails without a word.
Sitemaps are a small part of the go-live runbook and of any URL change. Small, but the first thing Google reads.
Got a similar problem? Talk to us.
Start a project