Every page canonicalized to the homepage
An e-commerce brand watched 4,000 product pages drop out of the index over a month, all 'duplicate, Google chose a different canonical.' The chosen canonical was always the homepage.
The symptom screamed misconfiguration, but the team's canonical tags pointed each product at itself. They double-checked the source. Correct everywhere.
The investigation compared raw HTML to rendered. In the raw server response, the <link rel="canonical"> was missing entirely — it was injected later by a client-side SEO component. And on first paint, before the route resolved, that component briefly stamped a default canonical pointing at /. The renderer caught the default value, not the corrected one.
Turns out canonicals assembled in JavaScript inherit whatever default exists at the moment Google reads the head — and a homepage default is the most dangerous default there is.
The fix: emit the correct self-referencing canonical in the server-rendered HTML for every route. No JS-injected canonicals, ever.
Result: 4,000 pages re-entered the index over six weeks, 'duplicate' reports fell from 4,100 to 60, and category-level organic traffic recovered +28%.
Hydrate Diaries
@HydrateDiaries
Every page canonicalized to the homepage
Этот пост опубликован в Telegram-канале Hydrate Diaries. Подписаться можно по ссылке: @HydrateDiaries.