Hidden hreflang-switcher mismatch left 1,474 dead links undetected across 737 pages
A web developer discovered 1,474 broken internal links spread across 737 pages of their own site, all caused by a mismatch between hreflang tags and the site's language switcher navigation. The hreflang tags correctly marked certain pages as English-only, but the language switcher unconditionally displayed Chinese language buttons on every page, pointing users to URLs that returned 404 errors. The bug evaded all standard automated checks because the pages themselves returned HTTP 200 responses and the hreflang configuration was technically valid. The root cause was two independent systems answering the same question — whether a page exists in Chinese — with conflicting answers. The fix involved making the language switcher consult the same English-only page list already used by the hreflang generator, eliminating all dead links in a single change.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in