# Hreflang Cheatsheet

**Last updated:** 2026-06-25  
**Source:** https://www.lawrencehitches.com/hreflang-cheatsheet/

---

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.

Missing return tags is the number one hreflang error. Download PNG

## 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](https://www.lawrencehitches.com/technical-seo-cheatsheet/). Validate it in Google Search Console after deploying.

This is one of [all the free SEO cheatsheets](https://www.lawrencehitches.com/cheatsheets/), all free.

## 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.

---

*Lawrence Hitches is an AI SEO consultant in Melbourne and Chief of Staff at StudioHawk, Australia's most awarded SEO agency. Agent edition of this site: https://www.lawrencehitches.com/md/index.md*