Skip to content
All tutorials

/tutorials/hreflang-tags-explained

Hreflang Tags Explained

What hreflang tags actually tell a search engine, why they need to point both ways between every language version of a page, and why one malformed code can undo the whole set.

5 min read

Run Hreflang Tag Checker

The problem hreflang tags solve

A site with separate pages for different languages or regions, like /en/, /fr/ and /en-au/, faces a real risk of search engines treating those pages as duplicate or competing content, and showing a visitor the wrong regional version in search results. Hreflang tags exist to tell a search engine directly which page is which, and which one to show a searcher based on their language and location.

How the tags are actually written

Each version of a page gets a link tag in the head, using rel="alternate" and an hreflang attribute set to a language code, optionally followed by a region, like en, fr, or en-AU. A special value, x-default, marks the version to show a visitor whose language does not match any of the others listed, commonly used for a language selection page or a sensible global default.

The tags have to point both ways

It is not enough for the English page to link to the French page; the French page has to link back to the English page too, listing the complete set of language versions on every single one of them. A one-directional link is explicitly ignored by search engines, which is one of the most common reasons a correctly written hreflang setup still doesn't work as intended.

The mistakes that break the whole set

  • An invalid or misspelled language code, which is silently ignored rather than flagged with an obvious error.
  • Missing reciprocal links, so the set isn't confirmed as matching from every page's point of view.
  • Pointing hreflang at a URL that itself redirects, rather than the final destination page.
  • Forgetting a page should also list itself in its own hreflang set, not only the other language versions.

Trying it yourself

Hreflang Tag Checker fetches a page and lists every hreflang tag it declares, checking each one's format and flagging duplicate values, so a malformed code can be caught on the page where it was written rather than discovered later in a search console report.