Services Process Experience Skills Cases Blog Contact
🌐 UA·RU·EN
July 8, 2026 · 9 min read

Hreflang Tags: What They Are and How to Set Them Up on a Multilingual Site

Hreflang tags tell Google which language or regional version of a page to show a user: the German page to someone searching in German, the British page to someone searching from the UK. Hreflang does not boost rankings or merge pages, it only helps Google put the right version in the results. Below are the syntax, the three ways to implement it, the rules without which Google ignores the markup, and a step-by-step setup for a site with several language versions.

Contents
  1. What hreflang does
  2. Syntax: language and region
  3. Three ways to implement hreflang tags
  4. Rules without which Google ignores hreflang
  5. Hreflang vs automatic IP redirects
  6. How to check your hreflang setup
  7. Common hreflang errors
  8. Example: a site with Ukrainian, Russian and English versions
  9. Hreflang checklist
  10. Frequently asked questions
  11. How I help with multilingual sites
  12. Summary

What hreflang does

Hreflang is an annotation that links pages with the same content in different languages or for different countries. When Google sees such a group of pages, it can show the one that matches the user's language and region in search results.

Three things to understand from the start:

Syntax: language and region

A hreflang value consists of a language code and, optionally, a region code separated by a hyphen. The language follows ISO 639-1 (two letters), the region follows ISO 3166-1 alpha-2 (two letters). Case does not matter.

ValueMeaningValid?
enEnglish, any countryYes
en-GBEnglish, users in the United KingdomYes
en-USEnglish, users in the United StatesYes
uk-UAUkrainian, users in UkraineYes
ru-UARussian, users in UkraineYes
en-UKThe code for the United Kingdom is GB, not UKNo
uaThere is no such language codeNo
uk is a language

Two classic mistakes come from the same confusion. "uk" is the language code for Ukrainian, so en-UK is invalid and the UK is en-GB. "UA" is the country code for Ukraine, so hreflang="ua" is invalid and Ukrainian is uk.

x-default: the version for everyone else

The x-default value marks the page to show when no language version matches the user. Usually it is the main language version or a language selector page. For an international product, x-default typically points to the English version.

Three ways to implement hreflang tags

Google supports three methods, and they are equivalent. Pick one and do not mix them, so you do not create contradictions.

MethodExampleWhen it fits
Link tags in the <head><link rel="alternate" hreflang="en" href="https://site.com/" />
<link rel="alternate" hreflang="de" href="https://site.com/de/" />
<link rel="alternate" hreflang="uk" href="https://site.com/uk/" />
<link rel="alternate" hreflang="x-default" href="https://site.com/" />
Regular HTML pages, most CMS-based sites
HTTP Link headerLink: <https://site.com/price.pdf>; rel="alternate"; hreflang="en", <https://site.com/de/price.pdf>; rel="alternate"; hreflang="de"PDFs and other files that have no <head>
XML sitemap<url><loc>https://site.com/</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://site.com/" />
<xhtml:link rel="alternate" hreflang="de" href="https://site.com/de/" /></url>
Large sites where generating a sitemap is easier than editing templates

In a sitemap, declare the namespace xmlns:xhtml="http://www.w3.org/1999/xhtml" in the urlset tag, and each URL in a url block must list all versions, including itself. How to build the sitemap itself is covered in the guide to robots.txt and sitemap.xml.

Rules without which Google ignores hreflang

Most problems are not in the syntax but in the logic of the links between pages.

Hreflang vs automatic IP redirects

A common idea is to detect the visitor's country by IP and immediately send them to the "right" version. For SEO this is harmful. Googlebot crawls mostly from IP addresses in the United States, so with a forced redirect it may never see your German or French version at all.

Google recommends not redirecting automatically and giving users a choice instead: a language switcher on every page or an unobtrusive banner suggesting another language. Hreflang solves the problem of showing the right version at the search results stage, without redirects.

I will check the hreflang tags on your site

Send me your site URL - I will review the language version markup, canonicals and server responses and tell you which errors keep Google from showing the right version.

Message me on Telegram

How to check your hreflang setup

Google Search Console currently has no dedicated hreflang report: Google retired the International Targeting report several years ago. So checks are done with other tools.

Common hreflang errors

ErrorConsequenceHow to fix
en-UK instead of en-GBThe UK version is not recognizedReplace with en-GB
No return linksGoogle may ignore the connectionThe same set of tags on all versions
Canonical to another languageThe version drops out of the indexSelf-referencing canonical
Link to a redirect or 404The connection breaksUse final URLs that return 200

Example: a site with Ukrainian, Russian and English versions

A typical structure for a business serving Ukraine: Ukrainian on the main domain, Russian and English in subfolders. As far as is known, Ukraine's state language law requires websites of companies serving consumers in Ukraine to have a Ukrainian version that loads by default. Check the details with a lawyer, but for SEO the conclusion is simple: the Ukrainian version is the main one, and x-default logically points to it.

01

Choose the codes

Ukrainian is uk, Russian is ru-UA if the audience is in Ukraine or ru if the version serves all countries. English is en without a region unless you have separate US or UK versions.

02

Build a mapping table

For each page, three URLs: https://site.com/poslugy/, https://site.com/ru/uslugi/, https://site.com/en/services/. If there is no translation, the page is simply left out of the group.

03

Add the tags to the template

Each of the three pages gets the same block of four tags: uk, ru-UA, en and x-default pointing to the Ukrainian version. Tags should be generated automatically in the template, not added by hand.

04

Check canonicals and indexing

Each version has a self-referencing canonical, no noindex, and all URLs return 200. The language switcher leads to the matching page, not to the homepage.

05

Crawl the site

After implementation, crawl the site with Screaming Frog or Ahrefs, and again after every template update. Hreflang most often breaks during a redesign.

Hreflang checklist

Frequently asked questions

Do I need hreflang tags if my site has only two languages?

Yes. Hreflang is needed as soon as a site has at least two language versions of the same pages. Without it, Google may show a Spanish-speaking user the English page or the other way round.

Does hreflang affect rankings?

Not directly. It does not pass ranking signals between versions, it only helps show the right language version in the results. Indirectly, this improves click-through rate and user behavior.

Which is better: hreflang in the head or in the sitemap?

For Google, the methods are equivalent. Tags in the head are easier to check in the page source, a sitemap is more convenient for large sites. The key is to pick one method and keep it free of contradictions.

How much does a hreflang setup cost?

A hreflang audit and developer specification are part of the technical work in my monthly SEO service, which starts from $450/month. The first step is a free express audit, where I will tell you whether your language versions have problems.

How I help with multilingual sites

For six years I led SEO for Ukraine International Airlines, a site that served 40+ markets with dozens of language versions. There I saw how one template error can mix up versions in the results of whole countries. For multilingual sites I provide:

Monthly SEO starts from $450/month, and the exact budget depends on the number of languages, site size and competition. I work remotely, with written communication in English via Telegram or email. For a full review of the technical basics, see the technical SEO audit guide.

Summary

Hreflang is simple in syntax but demanding in logic. Use valid codes, self-references, reciprocal links, absolute URLs and x-default, keep hreflang consistent with canonicals and do not force-redirect users. After every site update, check the markup with a crawler.

Get a free express audit

I will check your site's language versions, hreflang tags and canonicals and give you a prioritized list of fixes. If needed, I can take the site on for monthly SEO.

Send a request

Leave a request

Describe your task - I will reply within a few hours and suggest where to start in your case.

Thank you, your request has been received. I will get back to you shortly.
DZ

Dmytro Zaichenko

Freelance SEO Specialist · 13+ years of experience · 70+ projects · zaichenko.pro