RankpediaA plain-English encyclopedia of search

hreflang Implementation

Tells search engines which language or regional version of a page to serve to users based on their language or location.

Many people assume hreflang is a directive, but it is only a signal — Google may still show a different version if it judges it more relevant, and it does not automatically resolve duplicate content.

Key points

  • Include a self-referencing hreflang tag on every page in the cluster.
  • Ensure every variant links back to every other variant reciprocally.
  • Use absolute URLs that return a 200 status code, never redirects or 404s.
  • Add an x-default tag for a fallback page when no language or region matches.
  • Use ISO 639-1 language codes and ISO 3166-1 Alpha-2 region codes.

Three ways hreflang goes wrong

  • Missing reciprocal links If page A links to page B but B does not link back, Google may ignore the whole cluster. Every variant must reference every other variant.
  • Non-200 URLs in tags Using redirects or 404 pages in hreflang annotations breaks the signal. Each URL must return a 200 status code and serve the correct content.
  • Inconsistent implementation methods Mixing HTML tags, sitemaps, and HTTP headers for the same cluster confuses search engines. Pick one method and apply it uniformly.

Three things to check before deploying

  • Self-referencing tag present Each page must include a hreflang tag pointing to its own URL. Omitting it is one of the most common mistakes in international SEO.
  • ISO codes correct Use lowercase language codes (en, fr) and uppercase region codes (US, GB). Wrong codes, like 'EN' or 'gb', cause the tag to be ignored.
  • x-default fallback set When no language or region matches, the x-default tag tells Google which page to show. Without it, users may see an unexpected variant.

Common questions

How to implement hreflang?

Add <link rel="alternate" hreflang="x" href="URL"> tags in the <head> of each page, or use XML sitemaps or HTTP headers. Include all variants, including self.

How to add hreflang tags in WordPress?

Use a plugin like Yoast SEO or Rank Math, which add hreflang tags automatically for translated posts. Alternatively, edit your theme's header.php manually.

Sources

  1. Google Search Central: Localized Versions of your Pages Official documentation on hreflang implementation and best practices.
  2. Moz: Hreflang Tag Guide Clear explanation of hreflang syntax and common mistakes.
  3. Ahrefs: Hreflang Guide Detailed guide with examples and troubleshooting tips.