Hreflang: how to mark language versions correctly
28/07/2026
If your site is in Serbian, English and German, Google needs some way to know who gets which version. Hreflang does exactly that: it links the language and regional variants of the same page so a user in Germany gets the German version and one in Serbia gets the Serbian one.
What hreflang solves
Without hreflang, Google may show the wrong language or treat close translations as duplicates and cannibalize your rankings. With correct hreflang each version ranks in its own market, and bounce rates drop because users immediately see a language they understand.
What the syntax looks like
The basic format is a language or language-region code following the ISO standard: hreflang="sr", hreflang="en", hreflang="de-AT" (German for Austria). Alongside comes the special value hreflang="x-default" for a fallback page when no version matches the user. The key rule: the tags must be reciprocal — if the Serbian page points to the English one, the English page must point back to the Serbian one.
Three ways to implement it
- In the HTML <head>: most common, one <link rel="alternate" hreflang="..."> per version.
- In HTTP headers: for non-HTML files such as PDFs.
- In the XML sitemap: cleanest for large sites, since all tags stay in one place.
The most common mistakes
Wrong codes (e.g. "gb" instead of "en-GB", or an invented "rs" language code instead of "sr"), missing return links, and hreflang pointing to a URL that redirects. Hreflang must work in pairs with canonical tags: each version has a self-canonical while hreflang links them — never point the canonical of every language to a single version.
Structure and hosting
Hreflang works best with a clear URL structure; subdirectories /en/ and /de/ are easier to maintain than separate domains — more in the article on subdomain vs subdirectory and in the general guide to a multilingual website. For audiences across several countries, load speed everywhere matters too, so SEO hosting with a free global CDN keeps performance consistent even for diaspora visitors. See the plans if you are launching a multilingual version.