---
title: "Hreflang"
description: "The hreflang attribute tells search engines which language and region a page targets. Learn the syntax, self-referencing, x-default and common mistakes."
url: "https://nodea.io/en/glossary/hreflang"
lang: "en"
updated: "2026-07-13"
---

# Hreflang

> Hreflang is an HTML attribute that tells search engines which language and region a given page version is intended for. It helps serve users the correct language variant and prevents duplicate-content issues between translations.

**Hreflang** is an attribute used in a page's markup (or in the XML sitemap or HTTP headers) that tells search engines like Google which language, and optionally which region, a specific URL is meant for. Thanks to it, someone searching in a particular country is served the version that matches their language, and a multilingual site avoids [duplicate content](https://nodea.io/en/glossary/duplicate-content) problems between nearly identical translations.

## How hreflang works

The attribute value combines an ISO 639-1 language code with an optional ISO 3166-1 Alpha-2 country code — for example *en*, *en-GB* or *de-CH*. The most common implementation places link elements in the page head, and three rules are non-negotiable:

- **Self-referencing** — every page must also point to itself.
- **Reciprocity** — if page A points to B, then B must point back to A, or Google ignores the declaration.
- **x-default** — an extra value for users whose language matches none of the declared versions.

Alternatively, the whole set of relationships can be declared in the [XML sitemap](https://nodea.io/en/glossary/xml-sitemap), which is often more convenient for large sites where adding tags to every template is cumbersome.

## Practical application

Hreflang is essential for stores and sites operating across multiple markets — for example when the same offer exists in Polish, English and German versions, or when two variants of one language coexist (en-US and en-GB). The most frequent mistakes are missing self-references, one-way declarations and wrong region codes (such as using 'uk' instead of 'gb'). Implementation should be combined with a correct [canonical tag](https://nodea.io/en/glossary/canonical-tag) and regularly verified in Google Search Console, which reports detected hreflang inconsistencies.

### Does hreflang improve rankings?

It doesn't boost rankings directly, but it improves relevance — users in a given country see the right language version, which lowers bounce rate and prevents cannibalization between variants. Well-implemented hreflang keeps a multilingual site's indexing clean and organized.

### Does hreflang replace the canonical tag?

No, the two work in parallel. Canonical resolves duplicates within a single language version, while hreflang maps the relationships between different versions. Each page should have a self-referencing canonical plus a full set of hreflang entries pointing to its alternate versions.

## Related

- [Duplicate Content](https://nodea.io/en/glossary/duplicate-content)
- [Canonical tag](https://nodea.io/en/glossary/canonical-tag)
- [XML Sitemap](https://nodea.io/en/glossary/xml-sitemap)
- [SEO](https://nodea.io/en/glossary/seo)
- [Page indexing](https://nodea.io/en/glossary/page-indexing)

---

Languages: [pl](https://nodea.pl/pl/slownik-pojec/hreflang.md)  
Site index: [llms.txt](https://nodea.io/en/llms.txt)
