SEO
Hreflang: How to Tell Google About Language and Regional Versions
Key takeaways
- Hreflang is for pages that exist in several languages or regional variants; a single-language, single-region site does not need it.
- Google accepts HTML link tags, HTTP Link headers or XML sitemap entries and treats all three equally.
- Annotations must be reciprocal: if page A points to page B, B must point back to A or Google ignores them.
- Google does not use hreflang or the HTML lang attribute to detect a page's language; it uses its own algorithms.
- Use x-default for a fallback page such as a country or language selector.
What is hreflang and when should you use it?
Hreflang is an annotation that tells Google which pages are language or regional variations of the same content. Google's documentation says to use it when you have more than one version of a page, and it describes three situations: only the template (navigation, footer) is translated, the content differs slightly by region within one language, or the whole site is fully translated. Google may find alternate versions on its own, but the documentation says explicit annotations are usually better.
If your business serves one language in one region, you do not need it.
What are the three ways to add it?
- HTML link tags in the head of each page. Google notes this suits sites that cannot use a sitemap or set HTTP headers.
- HTTP Link headers, which are useful for non-HTML files such as PDFs.
- XML sitemap entries with alternate-link children.
Google treats the three methods equally. Using more than one adds maintenance work without any stated benefit, so choose the one your site can maintain most easily.
What rules must the annotations follow?
- Each version must list itself and every other version.
- URLs must be fully qualified, including the protocol. Alternate URLs may be on different domains.
- Annotations are bidirectional. If page A points to page B, page B must point back to A, or Google ignores the tags.
- If a language has several regional versions, provide a generic fallback for that language.
- Use x-default for a fallback page when no language matches, such as a country selector.
- HTML link tags must sit inside the head, and each version should carry the same set of links.
- Sitemap entries must live in the sitemap's own directory or below it.
Which language and region codes are valid?
The first part is an ISO 639-1 language code. An optional second part is an ISO 3166-1 Alpha-2 region code. Codes are case-insensitive, although uppercase region codes are the convention. A country code on its own is invalid, because Google will not infer a language from it. Script codes, such as those for Traditional and Simplified Chinese, are supported, and region codes can be added to them.
Does hreflang tell Google what language a page is in?
No. Google's documentation says it does not rely on hreflang or the HTML lang attribute to determine a page's language, and uses its own algorithms instead. Hreflang's job is to connect variants, not to label them.
Does hreflang prevent duplicate content problems?
Google says localized versions are considered duplicates only when the main content stays untranslated. A fully translated page is a different page for this purpose.
What are the common mistakes?
The documentation lists missing return links, invalid language or region codes, and reserved region codes. Google does not maintain or endorse third-party hreflang validators, so if you use one, treat its output as a lead to check, not as a verdict.
A practical checklist
- Confirm you really have multiple language or regional versions.
- Choose one method: link tags, headers or sitemap.
- List every version, including the page itself, on every version.
- Check that every pair links both ways.
- Add an x-default fallback if you have a selector page.
- Verify each code is a valid language, or language plus region, combination.
This article summarizes Google's published documentation as retrieved on the date above. Google can revise its guidance, and hreflang does not by itself guarantee which version appears in results.
Frequently asked questions
Do I need hreflang for a single-language website?
No. Google's documentation describes it for pages with multiple language or regional versions.
Which hreflang method does Google prefer?
None. Google treats HTML link tags, HTTP headers and XML sitemap entries equally.
Why does Google ignore my hreflang tags?
A common cause is a missing return link. Annotations must be reciprocal, so if page A points to page B, B must point back to A.
Does hreflang tell Google which language my page is written in?
No. Google says it uses its own algorithms to detect language, not hreflang or the HTML lang attribute.
Sources
- Tell Google about localized versions of your page — Google Search Central
Keep reading
See how AIrecommend.ai helps businesses get found and recommended by AI assistants.