Menu

Post image 1
Post image 2
1 / 2
0

A small hreflang bug that created hundreds of SEO errors

DEV Community: astro·MarinosVeis·3 days ago
#KZ5DyzxV
Reading 0:00
15s threshold

MarinosVeis

I recently ran into a painful SEO issue on a localized SaaS site.

Ahrefs showed hundreds of “missing reciprocal hreflang” errors.

The actual bug was small:

some localized privacy pages had valid URLs, but the hreflang matcher did not include the plain privacy slug as a safe alternate path.

So pages like:

  • /privacy/
  • /it/privacy/
  • /ar/privacy/
  • /hi/privacy/

existed, but they were not always returning the full alternate set.

That meant other localized pages pointed to them, but they did not point back.

Search crawlers see that as an incomplete hreflang cluster.

The lesson:

If you generate hreflang dynamically, do not only check whether a route “should” exist. Verify that every target actually renders and returns a reciprocal link.

I ended up writing a local check that crawls the built dist folder and verifies:

  • every alternate target exists
  • every alternate target links back
  • no internal links point to missing pages
  • no double-slash internal URLs exist

Not glamorous, but very useful.

Read More