Lizzard Solutions

Hreflang Tags: A Practical Guide for Multilingual Websites

· Lizzard Solutions
HreflangTechnical SEOMultilingual WebsiteInternational SEOSmall Business

By Nemanja Vukmirović, Lizzard Solutions. Last updated 19 November 2026.

You translated your website into a second language, but Google keeps showing English pages to Serbian searchers, or the Serbian page never gets indexed at all. The content is there; search engines just don't know which version belongs to which audience.

Hreflang tags solve that. This guide explains what they are, which language and region codes are valid, and how to implement them in HTML, in a sitemap or in an HTTP header. You will also see the exact tags running on lizzardsolutions.com, a table of common mistakes and a checklist you can work through today.

TL;DR

  • Hreflang tells Google which URL is the right version of a page for each language or region.
  • Every version must list itself and all other versions, and those links must be reciprocal.
  • Each language version keeps a self-referencing canonical; never point a canonical to another language.
  • Use x-default for the page you want people with unmatched languages to land on.

What are hreflang tags?

Hreflang tags are annotations, usually <link rel="alternate" hreflang="..."> elements, that tell search engines a page has equivalent versions in other languages or regions and give the URL of each. Google uses them to show searchers the version that matches their language or location.

Hreflang does not translate anything and is not a ranking boost. Google's guide to telling Google about localized versions of your page also notes that Google does not use hreflang or the HTML lang attribute to detect a page's language; it reads the visible content. Hreflang only connects versions that already exist.


Does your site need hreflang?

You need it when the same page exists in more than one language or regional variant. Typical cases for small businesses:

  • A Serbian company with Serbian and English versions of its website.
  • One language with regional differences, for example English pages with prices for the UK and for the US.
  • Serbian content published in both Latin and Cyrillic script, each on its own URL.
  • Translated PDFs such as price lists or catalogues.

You do not need it for a single-language site, or when the language switches only through a cookie or button on the same URL. In that case fix the URLs first. Google's page on managing multilingual and multi-regional sites recommends separate URLs per language, because Googlebot usually crawls from the US and sends requests without an Accept-Language header, so it may never see content that changes by browser settings.

Action: open one page in each language and confirm that the URL actually changes.


How hreflang codes work: language, region, script

A value starts with a language code in ISO 639-1 format, optionally followed by a region code in ISO 3166-1 alpha-2 format. Google also accepts a script subtag from ISO 15924, such as Latn or Cyrl. The W3C article on choosing language tags explains the subtags in more detail.

ValueMeaningValid?
enEnglish, any regionYes
en-GBEnglish for users in the United KingdomYes
srSerbian, any region and scriptYes
sr-RSSerbian for users in SerbiaYes
sr-Latn / sr-CyrlSerbian in Latin / Cyrillic scriptYes
en-UKUK is a reserved code, not the assigned one (GB)No, Google ignores the region
rsRS is a country code; region alone is not validNo
sr-SRSerbian for users in Suriname (SR is Suriname)Valid, but almost never what you mean

Tip

Start with language-only codes. Add a region only when the content really differs by country, for example prices, delivery terms or legal text.


Worked example: the hreflang tags on lizzardsolutions.com

Our own blog runs every post in English and Serbian. We checked the live HTML of one post with curl on 19 November 2026. This is what the English and Serbian versions of our Core Web Vitals article return:

<!-- https://lizzardsolutions.com/blog/core-web-vitals-explained -->
<html lang="en">
<link rel="canonical" href="https://lizzardsolutions.com/blog/core-web-vitals-explained" />
<link rel="alternate" hreflang="en" href="https://lizzardsolutions.com/blog/core-web-vitals-explained" />
<link rel="alternate" hreflang="x-default" href="https://lizzardsolutions.com/blog/core-web-vitals-explained" />
<link rel="alternate" hreflang="sr" href="https://lizzardsolutions.com/sr/blog/core-web-vitals-explained" />

<!-- https://lizzardsolutions.com/sr/blog/core-web-vitals-explained -->
<html lang="sr">
<link rel="canonical" href="https://lizzardsolutions.com/sr/blog/core-web-vitals-explained" />
<link rel="alternate" hreflang="en" href="https://lizzardsolutions.com/blog/core-web-vitals-explained" />
<link rel="alternate" hreflang="x-default" href="https://lizzardsolutions.com/blog/core-web-vitals-explained" />
<link rel="alternate" hreflang="sr" href="https://lizzardsolutions.com/sr/blog/core-web-vitals-explained" />

What each part does:

  • Self-reference: each page lists itself (the English page has hreflang="en" pointing to its own URL).
  • Reciprocity: both pages carry the same set of alternates, so each version links back to the other.
  • Self canonical per language: the Serbian page's canonical is the /sr/ URL, not the English one.
  • x-default: visitors whose language is neither English nor Serbian land on the English page.
  • Language-only codes: we use "sr", not "sr-RS", because the Serbian text serves Serbian speakers in any country and uses only Latin script.

Our XML sitemap repeats the same pairs with xhtml:link entries. Google treats HTML, sitemap and HTTP header as equivalent and says that using several gives no extra benefit, so if you do combine them, generate all of them from one source to keep them identical.

Action: run the same check on one of your own pages (the command is in the testing section below).


How to add hreflang tags: three copy-paste options

1. HTML link tags in the head

The most common method. Put the same block in the <head> of every version, with fully qualified URLs including https:

<head>
  <link rel="canonical" href="https://example.com/blog/pricing-guide" />
  <link rel="alternate" hreflang="en" href="https://example.com/blog/pricing-guide" />
  <link rel="alternate" hreflang="sr" href="https://example.com/sr/blog/pricing-guide" />
  <link rel="alternate" hreflang="x-default" href="https://example.com/blog/pricing-guide" />
</head>

2. XML sitemap with xhtml:link

Useful for large sites or when you cannot edit templates. Each URL gets its own entry, and every entry lists all versions, including itself:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <url>
    <loc>https://example.com/blog/pricing-guide</loc>
    <xhtml:link rel="alternate" hreflang="en" href="https://example.com/blog/pricing-guide" />
    <xhtml:link rel="alternate" hreflang="sr" href="https://example.com/sr/blog/pricing-guide" />
    <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/blog/pricing-guide" />
  </url>
  <url>
    <loc>https://example.com/sr/blog/pricing-guide</loc>
    <xhtml:link rel="alternate" hreflang="en" href="https://example.com/blog/pricing-guide" />
    <xhtml:link rel="alternate" hreflang="sr" href="https://example.com/sr/blog/pricing-guide" />
    <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/blog/pricing-guide" />
  </url>
</urlset>

3. HTTP Link header for PDFs

For files without an HTML head, send the alternates in the response header:

Link: <https://example.com/files/price-list.pdf>; rel="alternate"; hreflang="en",
      <https://example.com/sr/files/cenovnik.pdf>; rel="alternate"; hreflang="sr",
      <https://example.com/files/price-list.pdf>; rel="alternate"; hreflang="x-default"

Pick one method and use it everywhere. Then submit the sitemap and watch indexing in Search Console; our Google Search Console setup guide walks through it.


Common hreflang mistakes and how to fix them

MistakeWhat happensFix
No return linkGoogle ignores the pairAdd the same alternate set to every version
Missing self-referenceSet is incompleteEach page lists itself too
Canonical points to another languageThe translated page may drop out of the indexSelf canonical on each language version
Relative URLs (/sr/page)Annotation is not validUse full https:// URLs
Wrong codes (en-UK, rs, es-419)Value or region ignoredISO 639-1 language + optional ISO 3166-1 region
Alternate URL redirects or is noindexCluster is brokenPoint only to final, indexable 200 URLs
Auto-redirect by IP or browser languageGoogle and users cannot reach all versionsShow a language switcher link instead

The canonical rule comes from Google's guide to consolidating duplicate URLs: with hreflang, specify a canonical in the same language, or the best substitute language if none exists. Planning a redesign or new URL structure? Run through our website migration SEO checklist so hreflang survives the move.


How to test your hreflang tags

  1. Fetch the raw HTML of each version and check the lang attribute, canonical and alternates:
  2. Confirm every alternate URL returns 200, not a redirect or 404.
  3. Open the other version and verify it lists the first one back.
  4. In Search Console, use URL Inspection on both versions and compare the Google-selected canonical with yours.
curl -s https://example.com/blog/pricing-guide | grep -iE '<html|canonical|hreflang'

If you publish Serbian in two scripts, our guide to Latin vs Cyrillic website SEO shows how to label sr-Latn and sr-Cyrl pages.


Hreflang checklist

  1. Each language or region version has its own URL.
  2. Every version lists all versions, including itself.
  3. Links are reciprocal across the whole set.
  4. Codes use ISO 639-1 language and optional ISO 3166-1 alpha-2 region (GB, not UK).
  5. URLs are absolute, https, final and indexable.
  6. Each version has a self-referencing canonical.
  7. An x-default points to your fallback page.
  8. No automatic language redirects; a visible language switcher exists.
  9. One implementation method, generated from one source.

Hreflang is one part of a wider setup. Our technical SEO guide for small business covers indexing, canonicals, sitemaps and speed around it.


FAQ

Do hreflang tags improve rankings?

Not directly. Hreflang helps Google choose which existing version to show in each language or country, so searchers land on the right page. That can improve clicks and engagement, but it does not add ranking strength. A translated page still needs good content and links to rank.

Should I use sr or sr-RS for a Serbian page?

Use "sr" if the page is for Serbian speakers anywhere, which suits most sites. Use "sr-RS" only if you also have Serbian versions for other countries, such as Montenegro or Bosnia and Herzegovina, with different prices or terms. Never use "rs" alone, because RS is a country code, not a language.

Is x-default required?

No, but it is recommended. Google uses x-default when a searcher's language matches none of your versions. Point it to a language selector page or to your most widely understood version, often English. It must also appear in the alternate set on every version.

Can the canonical point to the English version?

No. If the Serbian page's canonical points to the English page, you are telling Google they are duplicates and the Serbian page may not be indexed. Give each language a self-referencing canonical and connect them with hreflang instead.

Get the URLs, codes, reciprocity and canonicals right once, generate them automatically, and every new translation will be picked up correctly from day one.

Check your multilingual setup

Our SEO check reviews indexing, canonicals, sitemaps and hreflang on your site and lists what to fix first.

Run the SEO check