Skip to content
10% off any project with promo code10% off with code

Hreflang for a Multilingual Site: the Technical Implementation

Contents
  1. What hreflang is
  2. Implementation in the HTML <head>
  3. Implementation in the XML sitemap
  4. x-default — a mandatory tag
  5. The usual mistakes
  6. Checking it
Published
Reading time
~2 min
Views
123
Reader rating
10 reviews
Author
Yevhen Fostenko
Senior Backend & DevOps Engineer
Hreflang for a Multilingual Site: the Technical Implementation Article
Need help with your website?
Describe the task on Telegram — I will assess it and suggest where to start. Reply within a day.
Message on Telegram
Free consultation and estimate. I reply quickly.

Without hreflang, Google shows users in Poland the Ukrainian version of your site and vice versa. Let us fix that properly.

What hreflang is

Hreflang is an HTML attribute that tells Google: "this page is for the uk-UA audience, and here is the equivalent version for en-GB". Google then shows the right language version to the right user.

Implementation in the HTML <head>

<link rel="alternate" hreflang="uk" href="https://example.com/page">
<link rel="alternate" hreflang="en" href="https://example.com/en/page">
<link rel="alternate" hreflang="x-default" href="https://example.com/page">

Important: every language version must reference every other (return tags). If the UA version has an hreflang pointing at EN, the EN version must have one pointing back at UA.

Implementation in the XML sitemap

<url>
  <loc>https://example.com/page</loc>
  <xhtml:link rel="alternate" hreflang="uk" href="https://example.com/page"/>
  <xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/page"/>
  <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/page"/>
</url>

x-default — a mandatory tag

x-default says which version to show when no matching language exists. Usually that is the primary (Ukrainian) version.

The usual mistakes

  • Missing return tags (a one-way reference)
  • No x-default
  • The wrong language code (uk instead of uk-UA)
  • Hreflang on a noindex page

Checking it

Google Search Console → International Targeting → Language. Or through Screaming Frog → Reports → Hreflang.

Need this implemented? Hreflang configuration or OpenCart multilingual setup.

Tags: hreflangmultilingualseointernationalgoogle
Need help with your website?
Describe the task on Telegram — I will assess it and suggest where to start. Reply within a day.
Message on Telegram
Free consultation and estimate. I reply quickly.

Related Articles

Technical SEO Audit: What to Check in 2025 Article

Technical SEO Audit: What to Check in 2025

Technical SEO in 2025 comes down to Core Web Vitals, mobile indexing and a sane site structure. Here is the full checklist for e-commerce. 1. Core Web Vitals…

02/06/2026 136

Reader reviews

5.0
Write a review