Back to notes

April 24, 2026 · 5 min read

A Canonical Tag Mistake That Deindexed Pages for Six Weeks

A templating bug pointed every product variant's canonical tag at the wrong URL. Google believed it. It took six weeks and a lot of patience to undo.

PostmortemSEO

A developer fixed what looked like an unrelated bug in a product variant selector and, as a side effect, changed how the canonical tag was generated for color and size variants. Instead of each variant canonicalizing to itself, every variant started canonicalizing to whichever variant happened to load first in the sitemap generation order.

Google believed the new signal immediately and faithfully. Within two weeks, roughly 1,200 variant pages had been dropped from the index because they'd been told, correctly as far as Google was concerned, that they weren't the canonical version of anything.

How we found it

Organic traffic on a category with heavy variant-based search demand dropped sharply, and Search Console's coverage report showed a spike in 'Alternate page with proper canonical tag' status for URLs that had no business carrying that status. That report entry is usually boring — it's supposed to mean the system is working correctly. Here it meant the opposite.

The scariest SEO bugs are the ones that look like the system working exactly as designed.

The fix and the slow recovery

  • Reverted the canonical tag logic to self-referencing per variant, deployed within 48 hours of diagnosis
  • Resubmitted the affected URLs via Search Console's URL inspection tool in priority batches
  • Added a canonical tag check to the deploy pipeline — any change touching that template now runs an automated spot check against a known set of URLs before shipping

Even after the fix shipped, recovery wasn't instant. Google had to recrawl each deindexed URL, re-evaluate the corrected canonical signal, and decide to trust it again, and that took roughly six weeks to fully resolve across the affected pages. The lesson that actually changed our process wasn't about canonical tags specifically — it was that any template change touching indexing signals needs an automated check before deploy, because by the time a human notices the traffic drop, the damage is already measured in weeks, not hours.