Hreflang tells Google which language or region version of a page to serve which users. The tag is <link rel="alternate" hreflang="en-au" href="...">, using an ISO 639-1 language code plus an optional ISO 3166-1 region code, with x-default for the fallback. The two rules that break most setups: every page must reference itself, and every alternate must link back. This is the one-page reference.
The hreflang format
| Value | Example | Means |
|---|---|---|
| Language only | hreflang="en" | English speakers anywhere |
| Language + region | hreflang="en-au" | English speakers in Australia |
| Another pairing | hreflang="fr-ca" | French speakers in Canada |
| Fallback | hreflang="x-default" | The default page when no other matches |
Where to put hreflang (pick one method)
| Method | Use when |
|---|---|
HTML <head> link tags | Standard HTML pages. The most common method |
| HTTP header | Non-HTML files like PDFs |
| XML sitemap | Large sites, to keep tags out of every page head |
The rules that break most setups
| Rule | What it means |
|---|---|
| Self-reference | Every page must include an hreflang tag pointing to itself |
| Return tags | If page A points to page B, page B must point back to A. Missing return tags is the number one error |
| Valid codes | Use ISO 639-1 for language and ISO 3166-1 alpha-2 for region. "en-uk" is invalid (it is "en-gb") |
| Absolute URLs | Always use full https URLs, not relative paths |
| One x-default | Set a single x-default for users no version targets |
Hreflang is part of technical SEO. Validate it in Google Search Console after deploying.
Frequently asked questions
What is hreflang used for?
Hreflang tells search engines which language or regional version of a page to show which users, so an Australian sees your en-au page and a Canadian sees your fr-ca page. It prevents the wrong-language page ranking and reduces duplicate-content confusion across international versions.
What is the most common hreflang mistake?
Missing return tags. If page A declares page B as an alternate, page B must declare A back. Without bidirectional confirmation Google ignores the annotations. The next most common errors are invalid codes (en-uk instead of en-gb) and relative URLs.
Do I need x-default?
It is recommended. x-default specifies the page to serve when no language or region version matches the user, such as an international landing page or a language selector. Without it, Google guesses the fallback.
Where should hreflang tags go?
Pick one method and stick to it: link tags in the HTML head (most common), HTTP headers (for non-HTML files like PDFs), or the XML sitemap (best for large sites). Do not mix methods on the same pages, it causes conflicts.
Soaring Above Search
Weekly AI search insights from the front line. One newsletter. Six sections. Everything that actually moved this week, with a practitioner's take.