Hreflang Explained Simply: Multilingual SEO Without the Headache

🔒 Security-reviewed 🧾 GPL open source 📤 No lock-in — export anytime ⚡ 20× lighter engine

Hreflang is a small piece of markup that tells search engines a page has versions in other languages or regions, and which version belongs to which audience. In Google’s own words, you use hreflang “to tell Google about the variations of your content, so that we can understand that these pages are localized variations of the same content.”

Without it, two problems appear. First, Google may serve the wrong language version to a searcher, showing an Italian visitor your English page. Second, near-identical pages (a translated page shares your structure, images, and layout) can look like duplicate content, leaving Google unsure which one to rank. Hreflang resolves both: it groups the versions as one piece of content in different languages and points each searcher to the right one.

Hreflang Explained Simply: Multilingual SEO Without the Headache

A simple example of the hreflang tag

Hreflang lives in the <head> of your page as a set of <link> tags — one per language version. Imagine a page that exists in English, Italian, and German:

<link rel="alternate" hreflang="en" href="https://example.com/page/" />
<link rel="alternate" hreflang="it" href="https://example.com/it/page/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/page/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/page/" />

The hreflang value is a language code (like en), optionally followed by a region (en-GB). Google accepts three equivalent methods to declare these: HTML <link> tags, HTTP Link headers, or a sitemap — you only need one. URLs should always be fully qualified, including https://.

The x-default tag (don’t skip it)

The last line above uses a reserved value, x-default. Per Google, “the reserved x-default value is used when no other language/region matches the user’s browser setting.” Think of it as the fallback: when a Portuguese or Japanese speaker lands on your site and you have no version for them, x-default tells Google which page to show. It’s ideal for a language selector or an auto-redirecting homepage, and it quietly prevents your site from guessing wrong for everyone you didn’t explicitly target.

The most common hreflang mistakes

Hreflang is unforgiving of small errors — a broken annotation is simply ignored. These are the ones that trip people up most:

  • Missing return tags. This is the big one. Google requires the links to be bidirectional: “If two pages don’t both point to each other, the tags will be ignored.” If your Italian page points to the English page, the English page must point back — and every version must reference itself, too.
  • Wrong language or region codes. Language codes use the two-letter ISO 639-1 format (en, not eng; ja, not jp). Region codes use ISO 3166-1 Alpha 2 (en-GB, not the invalid en-UK). And en-EU is wrong because “EU” is not a country.
  • Order reversed. It’s language-REGION (en-GB), never GB-en.
  • No x-default. Optional, but omitting it leaves visitors outside your targeted languages without a defined fallback.
  • Relative or non-canonical URLs. Always use absolute URLs with the protocol, and point hreflang at the canonical version of each page.
Hreflang Explained Simply: Multilingual SEO Without the Headache — detail

How hreflang relates to your URL structure

Hreflang doesn’t dictate your URLs, but the two work best together. The cleanest setup for a single domain is a language subdirectory: example.com/it/, example.com/de/, and so on. This keeps all your authority on one domain, is easy to crawl, and makes the hreflang mapping obvious — each prefixed URL simply corresponds to one hreflang value.

The subdirectory becomes the href in your tag, and the language becomes the hreflang value. Because the structure is predictable, the annotations can be generated mechanically rather than maintained by hand — which is exactly where a plugin earns its keep.

Why you shouldn’t hand-code hreflang

Hand-writing hreflang is where projects break. Every new page multiplies the tags you must keep in sync, and a single missing return tag silently voids the whole annotation. It doesn’t scale, and it’s tedious to audit.

A good multilingual plugin removes the work entirely. TranslateRocket — a free WordPress translation plugin supporting unlimited languages — generates correct, self-referential, bidirectional hreflang tags automatically (including x-default) alongside clean /it/, /de/ SEO URLs, so every version points to every other one without you touching the <head>. You can translate by hand, use free machine translation, or plug in your own AI keys, and it imports existing translations from WPML, TranslatePress, Polylang, and Weglot. A built-in Preview mode lets you check the result before going public. The output follows Google’s rules, so the search engine can serve the right language version and treat your translations as one piece of content — not duplicates.

Frequently asked questions

  • Is hreflang a ranking factor? Not directly. It’s a signal that helps Google serve the correct language or regional version to the right searcher and avoid duplicate-content confusion — which improves the experience and can lift performance in each market.
  • Do I need hreflang if my site is one language? No. Hreflang only applies when the same content exists in multiple languages or regional variants.
  • Language only, or language and region? Use language alone (en) when the content suits all speakers of that language. Add a region (en-GB, en-US) only when you genuinely have distinct versions per country.
  • Is x-default required? No, but it’s strongly recommended so visitors outside your targeted languages have a defined fallback page.
  • HTML tags, HTTP headers, or sitemap? Google treats all three as equivalent — pick whichever is easiest. Most WordPress sites use HTML <link> tags, which a plugin can output automatically.

Sources

Make your site multilingual — free


Keep reading

💬 Need help?
Powered by TranslateRocket™