02.06.2026
81
2 min read

Hreflang for a Multilingual Site: the Technical Implementation

Hreflang for a Multilingual Site: the Technical Implementation
Contents

    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.

    Related Articles
    Write a review
    Please login or register to review