Publishing the same page in more than one language, or for users in different countries, is a common way to grow internationally. When you do, Google needs to know which URLs are language or regional versions of the same content. That is the job of hreflang.
Hreflang is an annotation that tells search engines about the different language or regional versions of a web page. According to Google Search Central's "Tell Google about localized versions of your page," this helps Google Search point users to the most appropriate version by language or region. Showing the right version is also part of good user experience. The same page notes that localized versions are only considered duplicate content if the main content stays untranslated.
This entry covers what hreflang is, what it does for international SEO, the three ways to implement it and the most frequent mistakes. URL structure, canonicals and automatic redirects are outside the scope of this entry.
What Is Hreflang and What Does It Do?
Say a page on your site exists in Turkish and German. Hreflang tells Google that the two URLs are versions of the same content in different languages. Google then tries to show the German version to people searching in German and the Turkish version to people searching in Turkish.
Hreflang doesn't set a page's language. According to Google Search Central's "Managing multi-regional and multilingual sites," Google doesn't use code-level language information such as lang attributes, or the URL, to work out a page's language; hreflang instead tells it which version is meant for which language or region. Google notes it may find alternate versions even if you do nothing, but says it's usually best to declare them explicitly.
Why Use Hreflang
- The right version for the right user: it helps Google show searchers the version that fits their language or region.
- Same language, different countries: for similar pages in one language aimed at different countries (for example en-GB and en-US), hreflang helps Google serve the right regional URL in search.
- Explicit relationships: you declare how the versions relate instead of leaving Google to discover them.
How to Implement Hreflang
Google accepts language and regional variants in three ways: HTML tags, HTTP headers and an XML sitemap. Google Search Central says the three methods are equivalent from Google's perspective, and using all three at once brings no benefit in Search. Pick whichever is easiest to maintain on your site.
1. HTML Tags
Add one <link rel="alternate"> element to the <head> of each version for every variant, including the page itself. Example: your site has a Turkish (TR) and a German (DE) version. Both pages carry the same two lines in their <head>:
<link rel="alternate" hreflang="tr-TR" href="https://site.com/tr/page" />
<link rel="alternate" hreflang="de-DE" href="https://site.com/de/page" />
Important: the links must be reciprocal. Google says that if two pages don't both point to each other, the tags will be ignored. Each language version must list itself as well as every other version. If full reciprocal links get hard to maintain, you can leave some languages off some pages; Google still processes the pages that point to each other.
2. HTTP Headers (for PDFs and Other Non-HTML Files)
For non-HTML files such as PDFs, declare the versions in a Link: header in the server response. List every version, including the one requested:
Link: <https://site.com/tr/page.pdf>; rel="alternate"; hreflang="tr-TR", <https://site.com/de/page.pdf>; rel="alternate"; hreflang="de-DE"
3. XML Sitemap
You can also declare hreflang in your XML sitemap, which can be more practical than editing the <head> of every page on a large site. Each <url> element lists every version, including itself, as xhtml:link children, and the sitemap declares the xhtml namespace (xmlns:xhtml="http://www.w3.org/1999/xhtml").
Example:
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"> <url> <loc>https://site.com/tr/page</loc> <xhtml:link rel="alternate" hreflang="tr-TR" href="https://site.com/tr/page"/> <xhtml:link rel="alternate" hreflang="de-DE" href="https://site.com/de/page"/> </url> <url> <loc>https://site.com/de/page</loc> <xhtml:link rel="alternate" hreflang="tr-TR" href="https://site.com/tr/page"/> <xhtml:link rel="alternate" hreflang="de-DE" href="https://site.com/de/page"/> </url> </urlset>
Common Hreflang Mistakes
- Missing return links: if page A points to page B but B doesn't point back to A, the tags on both are ignored.
- Forgetting x-default: Google recommends hreflang="x-default" for the fallback page shown when no language or region matches; the value was designed for language selector pages.
- Invalid codes: only ISO 639-1 language codes and ISO 3166-1 Alpha 2 region codes are supported. A region code can't stand alone; the first code is always the language. Writing just "be" for Belgium targets Belarusian, not Belgium; use "fr-BE" for French in Belgium. Values are case-insensitive, so Google accepts "tr-TR" and "tr-tr" alike; writing the region in uppercase follows ISO convention.
- Relative or broken URLs: alternate URLs must be fully qualified, including http:// or https:// (not a relative path like /page); check that they resolve and don't return a 404.
Conclusion
For a site that publishes in more than one language or region, hreflang is how you tell Google how the versions of a page relate. Once it's in place, check reciprocity, code validity and URL accessibility regularly.
Hreflang is one technical piece of the international side of your SEO strategy; plan it together with URL structure and canonicals.
Last updated:












