---
title: "Hreflang"
description: "Hreflang: linking the language versions of a page, syntax, x-default, the reciprocity rule, common errors and the case of a multilingual WordPress site."
language: "en"
locale: "en-US"
type: "definition"
canonical: "https://www.wp-masquerade.com/glossary/hreflang/"
published: "2026-10-28T08:00:00+00:00"
modified: "2026-10-28T20:05:05+00:00"
translations:
  en-US: "https://www.wp-masquerade.com/glossary/hreflang/index.md"
  fr-FR: "https://www.wp-masquerade.com/fr/definitions/hreflang/index.md"
  es-ES: "https://www.wp-masquerade.com/es/glosario/hreflang/index.md"
  de-DE: "https://www.wp-masquerade.com/de/glossar/hreflang/index.md"
  it-IT: "https://www.wp-masquerade.com/it/glossario/hreflang/index.md"
  pt-BR: "https://www.wp-masquerade.com/pt/glossario/hreflang/index.md"
  nl-NL: "https://www.wp-masquerade.com/nl/woordenlijst/hreflang/index.md"
---

# Hreflang

Hreflang is an HTML attribute that tells search engines about the different language or regional versions of the same page. It lets Google show each searcher the version suited to their language or country, provided every version references all the others reciprocally.

A site translated into several languages, or tailored by country within the same language (United States, United Kingdom, Canada…), offers several versions of the same page. Without any hint, Google may show the English version to a French speaker, or treat nearly identical regional variants as duplicates. The hreflang attribute connects these versions and states the language, and optionally the region, of each one. The search engine can then show the right version in each user's [search results](https://www.wp-masquerade.com/glossary/serp/).

## The syntax

```
<link rel="alternate" hreflang="fr" href="https://example.com/fr/guide/">
<link rel="alternate" hreflang="en" href="https://example.com/en/guide/">
<link rel="alternate" hreflang="fr-CA" href="https://example.com/ca/guide/">
<link rel="alternate" hreflang="x-default" href="https://example.com/en/guide/">
```

- **The value** combines a two-letter language code (ISO 639-1) and, if needed, a country code (ISO 3166-1 alpha-2): `en`, `en-US`, `en-GB`. A country code on its own is not valid: `be` means Belarusian, not Belgium.
- **The `x-default` value** designates the page to show when no language matches, for example a language selector or the international version.
- **URLs** must be fully qualified, including the protocol and domain.

Google accepts three equivalent placements: `<link>` elements in the HTML head, an HTTP `Link` header (handy for PDFs), or entries in the [XML sitemap](https://www.wp-masquerade.com/glossary/xml-sitemap/). One is enough; on a large site, the sitemap is often the easiest to maintain.

## The reciprocity rule

Each version must list every other version and itself. If the French page declares an English version but the English page doesn't link back to the French one, Google ignores these annotations. This is the most common source of errors, especially when a translation is added or removed without updating the other pages.

![Three columns for the French page, the English page and the German page. Each one contains the same list: hreflang fr to /fr/guide/, hreflang en to /en/guide/, hreflang de to /de/guide/ and hreflang x-default to /en/guide/. Note: if two pages don't reference each other, Google ignores their annotations.](https://www.wp-masquerade.com/media/2026/10/hreflang-versions-reciproques-en.webp)

*The same set of hreflang tags appears on every version of the page.*

*Video: “How serving works, hreflang, and more!” (Google Search Central)*

## Common mistakes

- **Non-reciprocal links**, or links pointing to redirected pages, 404 errors or `noindex` pages.
- **Hreflang that contradicts canonicals**: each version must have its own [canonical URL](https://www.wp-masquerade.com/glossary/canonical-url/), pointing to itself, not to the main version.
- **Made-up codes**: `en-UK` instead of `en-GB`, or `en-US-texas`.
- **Relying on hreflang to signal the language**: Google states that it uses neither hreflang nor the HTML `lang` attribute to detect a page's language. The text itself is what counts, hence the importance of real translations rather than half-translated pages.
- **Automatically redirecting based on the browser language**: a crawler working from a single country may never see some versions. Offer a language switcher instead.

Properly tagged regional variants also keep them from being treated as competing [duplicate content](https://www.wp-masquerade.com/glossary/duplicate-content/).

## For WordPress

WordPress doesn't support multilingual sites natively, and therefore doesn't output hreflang tags. Multilingual plugins take care of it: Polylang, for example, automatically adds hreflang tags between linked translations, but only generates `x-default` for the home page, in certain configurations. WPML and other solutions have their own settings. In every case, check the source code of a few pages and the Search Console report after adding a language, and avoid stacking an SEO plugin and a multilingual plugin that would each output their own tags.

## Related terms

- [Canonical URL](https://www.wp-masquerade.com/glossary/canonical-url/)
- [Duplicate content](https://www.wp-masquerade.com/glossary/duplicate-content/)
- [XML sitemap](https://www.wp-masquerade.com/glossary/xml-sitemap/)
- [SERP](https://www.wp-masquerade.com/glossary/serp/)
- [Indexing](https://www.wp-masquerade.com/glossary/indexing/)


## Sources

- [Google Search Central : versions localisées de vos pages](https://developers.google.com/search/docs/specialty/international/localized-versions)
- [Polylang : les attributs hreflang et Polylang](https://polylang.pro/hreflang-tag-attributes-and-polylang-everything-you-need-to-know/)
