What it looks like
Each version lists all the versions, including itself, in its <head>:
<link rel="alternate" hreflang="en" href="https://www.example.com/en/">
<link rel="alternate" hreflang="sv-se" href="https://www.example.com/se/">
<link rel="alternate" hreflang="x-default" href="https://www.example.com/">
Rules that matter
- Use ISO codes: the language first (en, sv, de), then an optional country (en-gb, sv-se).
- Links must go both ways: if page A points to page B, page B must point back to page A.
- Every version should include a reference to itself.
- Use x-default for the page shown to everyone else, such as a language selector.
- Point only to indexable, canonical URLs that return a 200 status code.
Other ways to add hreflang
Instead of tags in the HTML, you can list the versions in your XML sitemap, or in HTTP headers for files such as PDFs. Hreflang is a signal, not a redirect: it doesn’t move visitors, and Google may still show another version if the content isn’t clearly localized.
Common hreflang mistakes
- Missing return links: page A points to B but B does not point to A, so Google ignores the annotation.
- Invalid codes: a region on its own, or codes such as
UK(the country code isGB). - Pointing to redirected, blocked or noindex pages.
- Inconsistent sets: each version lists a different group of alternates.
- Using several methods that disagree. Google treats HTML, header and sitemap annotations as equivalent, so pick one.
How to test hreflang
Crawl the site with a tool that checks hreflang, such as Screaming Frog, Semrush or Ahrefs, and fix missing return links and invalid codes. Check in Search Console that each version is indexed. Search from the target country to see which version appears.
Hreflang FAQs
Does hreflang improve rankings?
No. It helps show the right version to the right searcher.
Do I need hreflang for one language?
Only if you have several versions, such as English for different countries. For a full guide, read our article on multilingual SEO.