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
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
- Your site has the same content in several languages.
- You have separate pages for different countries, such as prices in different currencies.
- You write in Roman Urdu and English and want each to reach the right readers.
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.
en-us: English for the USApt-pt: Portuguese for Portugalhi-in: Hindi for Indiaur-pk: Urdu for Pakistanx-default: the page to show when no other version fits
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
- Return links: if page A points to page B, page B must point back to page A. Without this, Google may ignore the tags.
- Full addresses: use complete URLs that start with https.
- Self reference: each page lists itself in the set.
- Valid codes: use real language and country codes. "en-uk" is wrong, the country code for the United Kingdom is GB.
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
- Missing return links between versions.
- Using a wrong code such as en-uk instead of en-gb.
- Translating only the menu and leaving the main text in another language.
- Redirecting visitors automatically by their location, which can block both people and Google from seeing other versions. Offer a language switcher instead.
- Using machine translation without checking it. Poor text hurts trust, so read it before publishing.
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
- What Is a Canonical Tag and Why Does It Matter?
- What Is Schema Markup? A Beginner Guide
- What Is a Sitemap and How Do You Submit It?
- SEO Kya Hai? Aasan Alfaz Mein Samjhein (Roman Urdu)
Free tools: Free website checker in Urdu · Free website speed test · Free SEO checker in Roman Urdu
Check my website free