Back to Blog
SEO & AI Search

hreflang Explained: How to Set Up Multilingual and Multi-Country SEO Correctly

hreflang tells Google which version of a page to show to which visitor. Here is how it works, the exact tags to use, the mistakes that make it fail and a free generator to write it for you.

T
Tejas Patel·Founder & CEO, VeltrexLabs
October 29, 20268 min read

Short answer: hreflang is a set of tags that tells search engines which language or country version of a page to show each visitor. Every version must list all the versions, including itself, and each must point back to the others, or the tags are ignored.

What do the tags look like?

For an English page with a Hindi version, the head of both pages contains the same three lines: a link rel=alternate with hreflang=en and the English URL, one with hreflang=hi and the Hindi URL, and one with hreflang=x-default pointing at the fallback.

Which codes do you use?

  • Language: ISO 639-1 codes such as en, hi, gu, es, fr.
  • Language and region: add an ISO 3166-1 region, such as en-gb or pt-br.
  • Use hyphens, not underscores, and do not invent codes like 'english' or 'en-uk'.

What goes wrong most often?

  1. 1.No return link: the Hindi page does not list the English page back.
  2. 2.Wrong or made-up codes.
  3. 3.Alternate URLs that redirect, return errors or are blocked by robots.txt.
  4. 4.A canonical tag pointing at a different language version.
  5. 5.Translating body text but leaving titles, descriptions and structured data in the original language.
  6. 6.One URL that swaps languages with a script, so there is nothing separate to index.

A simple setup that works

  1. 1.Give each language its own URL, for example /en, /hi and the default for Gujarati.
  2. 2.Add a self-referencing canonical to each page.
  3. 3.Add the full hreflang set, with x-default, to every version.
  4. 4.Link between versions with a real language switcher.
  5. 5.List every version in your sitemap.
Free tool

Enter your language versions and get the exact tags or sitemap entries.

Open the hreflang generator
Worked examples

How two live products handle Gujarati, Hindi and English.

Read the multilingual guide
Check your pages

Our meta tag checker shows canonical and hreflang for any page.

Open the meta tag checker

Frequently asked questions

What does hreflang do?

It tells search engines that several pages are versions of the same content in different languages or for different regions, so each searcher is shown the version that fits them.

Do I need hreflang if I only have one language?

No. It matters when you publish the same content in more than one language or for more than one country.

Is x-default required?

It is not required but recommended. It marks the fallback page for visitors whose language you do not support, often a language selector or your main English page.

Why is Google ignoring my hreflang?

The usual cause is missing return links: every version must list all the others and itself. Other causes are invalid codes, alternates that redirect or are blocked, and canonicals pointing at a different language.

Can I put hreflang in the sitemap?

Yes. You can use HTML head tags, HTTP headers or XML sitemap entries. Choose one method and keep it consistent.

hreflangMultilingual SEOInternational SEOMulti-country Websitex-defaultLanguage TagsVeltrexLabs
T

Tejas Patel

Founder & CEO, VeltrexLabs

Tejas is the Founder & CEO of VeltrexLabs, a product-focused development agency that has shipped MVPs for 13+ startups across food-tech, SaaS, e-commerce, and enterprise software.

Have a question about this?

Ask us directly. We answer within one working day, whether you are in India, the UK, Europe or the US.

Ready to Transform Your Digital Presence?

Take the first step towards digital success with VeltrexLabs by your side. Our team of experts is eager to craft tailored solutions that drive growth for your business. Whether you need a stunning website, a powerful mobile app, or a data-driven marketing campaign, we've got you covered. Let's embark on this transformative journey together.

Unlock Your Digital Potential Today