What Is Hreflang?
Updated 18 September 2026
Jump to section
Hreflang is an HTML attribute that tells Google which language or regional version of a page to show each searcher. You add it as <link rel="alternate" hreflang="en-my" href="..."> tags in the page's head, as an HTTP header, or inside your sitemap. It does not translate anything, and it is not a ranking factor. Its one job is to match the right existing version of a page to the right user, and to keep near-identical language versions from competing as duplicates.
What does hreflang actually do?
Hreflang points a searcher to the version of your page built for their language or country. Say you publish one page in English for Malaysia and another in Simplified Chinese. Hreflang tells Google the two are alternates, so it can serve the Chinese version to a Chinese-language searcher.
It solves two problems at once.
The first is showing the wrong version. Without hreflang, a searcher in Kuala Lumpur might land on your UK English page instead of your Malaysian one, with the wrong prices or contact details.
The second is duplicate confusion. Two pages of nearly identical English, one for Malaysia and one for Singapore, can look like duplicate content to Google.
Hreflang tells it they are deliberate regional alternates, not copies. A canonical tag handles duplicates within one language; hreflang handles them across languages and regions.
How do you write an hreflang tag?
An hreflang tag names a language, optionally a region, and the URL of that version. The language uses an ISO code, and the optional region follows it. So en is English, en-my is English targeting Malaysia, and zh is Chinese.
Google supports three ways to declare it. You can use <link> tags in the HTML head, an HTTP header for non-HTML files, or entries in your XML sitemap. Pick one method and use it consistently.
Two rules matter most.
Tags must be bidirectional. If your English page points to the Chinese version, the Chinese page must point back, or Google ignores the pair.
You should also add an x-default value. It names the fallback page to show when no language version matches the searcher, which is often your main or language-selector page.
| Common value for Malaysia | Who it targets |
|---|---|
en |
English speakers anywhere |
en-my |
English speakers in Malaysia |
zh-Hans |
Simplified Chinese readers |
zh-Hant |
Traditional Chinese readers |
x-default |
Everyone else, as a fallback |
Source: Tell Google about localized versions of your page, Google Search Central.
For Chinese, the script code matters more than the country. zh-Hans means Simplified Chinese, used in mainland China and common among Malaysian Chinese readers online. zh-Hant means Traditional. Naming the script avoids serving the wrong character set.
A whole region can also be targeted by domain, such as a .my domain for Malaysia. Hreflang is the tool when the versions share one domain instead.
Does hreflang help SEO or rankings?
Hreflang is not a ranking factor, and it will not lift a page up the results on its own. What it improves is which version of an already-ranking, indexed page appears, so the searcher sees the right language and region.
That still matters commercially. A visitor who lands on the version written for them, with local pricing and language, is far more likely to stay and buy. One dropped onto a foreign edition often leaves.
There is a limit worth knowing. Google works out a page's language from its visible content, not from your code.
Google states plainly that it uses the visible content of your page to determine its language (Google Search Central, updated December 2025). It does not read code-level information such as lang attributes or the URL.
So hreflang only helps once genuinely separate, translated pages exist. Tagging a single English page as if it were three languages does nothing.
When does a Malaysian business need hreflang?
Hreflang earns its place once you publish real alternate versions of the same pages. The two common triggers in Malaysia are running an English and a Simplified Chinese site, or serving both Malaysia and Singapore with separate English pages.
A single-language site does not need it. If you publish only in English for one market, there are no alternates to declare, and adding hreflang adds risk without benefit.
A pattern we see is teams adding hreflang before the translated pages exist, expecting the tag to do the translating. The tag is plumbing, not translation, so the pages it connects have to be real first.
Frequently asked questions
Does hreflang affect my Google ranking?
No, hreflang is not a ranking signal and will not move a page up or down. It changes which language or regional version of a page Google shows, not how high that page ranks. The gain is indirect: a searcher who sees the version built for their own language and region is more likely to stay and buy.
What is the difference between hreflang and the lang attribute?
Hreflang and the HTML lang attribute do different jobs. Hreflang tells search engines that several URLs are language alternates of each other, so the right one is served in results. The lang attribute marks the language of the current page for browsers and screen readers. Google judges page language from visible content, so neither replaces actually translating the page.
Do I need hreflang for English and Chinese on one site?
Yes, if the English and Chinese versions live on separate URLs. Hreflang links each English page to its Chinese counterpart so Google serves the right one, using zh-Hans for Simplified Chinese. If you instead mix both languages on a single page, that is a different setup, and Google advises keeping one language per page.
What does the x-default value do?
The x-default value names the page to show when no language version fits the searcher. It is the fallback for a visitor whose language you have not published, often a language-selector or main international page. Adding it is optional but recommended, because it stops Google guessing which version to show a searcher you did not plan for.
What happens if my hreflang tags are not reciprocal?
Google ignores hreflang tags that do not point back to each other. If your English page lists the Chinese version as an alternate, the Chinese page must list the English version in return. When the return tag is missing, Google treats the declaration as unconfirmed and may serve the wrong version anyway.
Can hreflang fix duplicate content between my Malaysian and Singapore sites?
Yes, that is one of its main uses. Two pages of near-identical English for Malaysia and Singapore can look like duplicates to Google. Hreflang marks them as deliberate regional alternates, so Google serves the Malaysian page to Malaysian searchers and the Singapore page to Singapore ones, rather than hiding one.
Serve every visitor the version built for them
Storming Solutions builds and maintains websites and runs SEO, AEO, and GEO from Kuala Lumpur. Reserving the multilingual architecture early is part of how we plan a serious site, so an English build can gain a Simplified Chinese edition later without a costly rebuild.
Planning an English and Chinese site, or serving customers across Malaysia and Singapore? Message us on WhatsApp or start with the SEO in Malaysia pillar. Our SEO, AEO, and GEO work makes sure the right page reaches the right searcher.