What Is Hreflang? | Hawk Academy
Home What's Included About Us SEO Instructors Resources SEO Roadmap SEO Templates Claude SEO Skills AI SEO Prompts SEO Tools SEO & AI Search Guides SEO & AI Search Glossary Contact Sign In Enroll For Free
SEO Fundamentals

Hreflang

LH
Lawrence Hitches
19 October 2026 4 min read

Definition

Hreflang is an annotation listing the language and regional versions of a page, so a search engine can show each searcher the version that fits. Google accepts it three ways, in HTML link elements, HTTP headers or an XML sitemap, and treats the three as equivalent.

Example. An Australian and a UK version of the same pricing page each carry two lines, hreflang="en-au" and hreflang="en-gb", pointing at both URLs. Remove the lines from either page and Google ignores the pair.

You can check that every alternate links back, and that the page lists itself, with the free Hreflang Tester.

Does Google use hreflang to work out a page's language?

Google does not use hreflang to work out a page's language. Google states that it uses neither hreflang nor the HTML lang attribute to detect language, and relies on its own algorithms instead. Hreflang does a narrower job: it tells Google which URLs are versions of each other, so it can swap in the right one.

Hreflang breaks most often because of missing return links. Google requires each version to list itself and every other version. If two pages do not point to each other, Google ignores the tags between them, while still processing the pages that do link both ways.

The second most common break is the URL format. Alternate URLs must be fully qualified, including the protocol, so https://example.com/foo works and /foo or //example.com/foo do not.

Which language and region codes are valid?

Valid values are an ISO 639-1 language code, optionally followed by an ISO 3166-1 Alpha 2 region code. Google supports nothing outside those two lists, and a region on its own is not allowed.

ValueValid?Why
enYesLanguage only: any English speaker
en-auYesEnglish, in Australia
en-gbYesEnglish, in the United Kingdom. Its ISO code is GB
en-ukNoUK is not a valid region code. The United Kingdom is GB
auNoA region cannot be specified by itself
x-defaultYesThe fallback when no other version matches the searcher's browser setting

Does hreflang work when one URL changes language?

Hreflang does not work when one URL serves every language, because the annotation points at URLs, so each version needs its own. A page that changes its language based on the visitor's browser settings, at the same address, gives hreflang nothing to point at.

Learn SEO and AI Search. For Free.

The full Hawk Academy course is free, with no email wall on any resource.

Enroll in Hawk Academy