Home › Blog › What Is Hreflang? A Simple Guide for Multi-Language and Multi-Country Sites

What Is Hreflang? A Simple Guide for Multi-Language and Multi-Country Sites

By Umar Hayat · Updated 16 November 2026

If your website has pages in more than one language, or versions for different countries, search engines need help to show the right page to the right person. Hreflang is the signal that does this. This guide explains it in simple words.

What hreflang does

Hreflang is a small piece of information that says: "this page is for this language and this country, and here are the other versions". For example, a page in English for the USA, one in English for the UK and one in Portuguese for Portugal can all point to each other. Google can then show Portuguese readers the Portuguese page instead of the English one.

When you need it

If your site has only one language and one audience, you do not need hreflang at all.

Language and country codes

A hreflang value is a language code, and optionally a country code after a dash. Language codes are two letters, such as en for English, pt for Portuguese, hi for Hindi and ur for Urdu. Country codes are also two letters, such as US, PT, IN and PK.

Use a country code only when the content really differs for that country. The language alone, such as en, is often enough.

A working example

Put these lines inside the head of every version of the page. Each page must list itself and all the others:

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

The four rules that matter

Hreflang and canonical tags

Each language version should have its own canonical tag pointing to itself. Do not point the Portuguese page's canonical to the English page, because that tells Google to ignore the Portuguese one. If you are not sure how canonical works, read what a canonical tag is.

Other ways to add hreflang

Besides the head tags, you can put hreflang in your XML sitemap or in HTTP headers. For small sites the head tags are the easiest. If your pages are generated by a platform, check whether it already has a multilingual setting before adding tags by hand. See what a sitemap is for the basics.

Common mistakes

Helpful habits for a multi-language site

Keep the same structure in every language so that links match. Translate titles and descriptions too, not only the body. Add a visible language switcher. Test each version with a speed check, because extra fonts for other scripts can slow a page. Finally, add every version to your sitemap and check the pages in Search Console.

How to test your setup

After adding the tags, open each version of the page and view the source to confirm that the full set of links is present and that every address starts with https. Then open the same pages in Google Search Console and look for errors or warnings about alternate pages. Fix the return links first, because they are the most common problem. Give Google some time to read the changes, since it can take days or weeks. If your pages are generated by a template, check one page of each language and then trust the template for the rest.

Questions

Does hreflang improve my ranking?

Not directly. It helps Google show the right version to the right audience, which can improve clicks and reduce visitors leaving.

Is hreflang required for translated pages?

It is not required, but it is strongly recommended when you have the same content in several languages or countries.

What is x-default?

It marks the page to show when none of your language or country versions fits the visitor, often a language selection page or the main version.

Can I use hreflang on a single page?

It only makes sense when there are at least two versions of the page, and each version must point to the other.

Related articles

Free tools: Free website checker in Urdu · Free website speed test · Free SEO checker in Roman Urdu

Check my website free