Skip to main content
Back to blog

Hreflang Tags: Complete Guide for Multi-Language Sites

What Are Hreflang Tags?

Hreflang tags tell Google which language and regional version of a page to show to users. Without them, Google might show the English version to a French user, or the US version to a UK user.

When You Need Hreflang

You need hreflang if:

- Your site has pages in **multiple languages** (e.g., English + Spanish)

- You have **regional variations** of the same language (e.g., en-US vs en-GB)

- You have a **default version** for users whose language isn't specifically targeted

Basic Syntax

<link rel="alternate" hreflang="en" href="https://example.com/page">

<link rel="alternate" hreflang="es" href="https://example.com/es/page">

<link rel="alternate" hreflang="fr" href="https://example.com/fr/page">

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

The 5 Rules of Hreflang

Rule 1: Always Include x-default

x-default is the fallback for users whose language isn't specifically targeted:

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

Rule 2: Self-Reference

Every page must include a hreflang pointing to itself:

<!-- On the English page: -->

<link rel="alternate" hreflang="en" href="https://example.com/page">

Rule 3: Reciprocal Links

If page A links to page B, page B must link back to A:

<!-- On English page: -->

<link rel="alternate" hreflang="es" href="https://example.com/es/page">

<!-- On Spanish page: -->

<link rel="alternate" hreflang="en" href="https://example.com/page">

Rule 4: Valid Language Codes

Use ISO 639-1 codes:

- ✅ en, es, fr, de, tr, ja, zh

- ✅ en-US, en-GB, pt-BR, zh-TW

- ❌ english, eng, en_US

Rule 5: Absolute URLs

Always use full URLs, not relative:

- ✅ https://example.com/page

- ❌ /page

Implementation Methods

Method 1: HTML Head (Recommended)

<head>

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

</head>

Method 2: HTTP Header

Link: <https://example.com/>; rel="alternate"; hreflang="en",

      <https://example.com/tr/>; rel="alternate"; hreflang="tr"

Method 3: Sitemap

<url>

  <loc>https://example.com/</loc>
  <xhtml:link rel="alternate" hreflang="en" href="https://example.com/"/>
  <xhtml:link rel="alternate" hreflang="tr" href="https://example.com/tr/"/>

</url>

Common Mistakes

1. **Missing x-default** — Google doesn't know which is the fallback

2. **Missing self-reference** — breaks the reciprocal chain

3. **Invalid language codes** — "english" instead of "en"

4. **Relative URLs** — must be absolute

5. **One-way links** — both pages must reference each other

Checking Your Hreflang

[SEO Snapshot](/) automatically checks:

- x-default presence

- Self-referencing hreflang

- Valid ISO 639-1 language codes

- Hreflang tag count and languages

FAQ

**Q: Does hreflang affect rankings?**

A: It doesn't boost rankings but ensures the right page shows to the right user, improving CTR and reducing bounce rate.

**Q: Can I use hreflang with a single-language site?**

A: Generally not needed. But if you target specific regions (en-US vs en-GB), it helps.

**Q: What if I only have 2 languages?**

A: You still need hreflang. Include both languages + x-default on every page.

Check your site's SEO score for free

Analyze your site