Navigating the internet’s global reach presents unique challenges for website owners aiming to connect with diverse audiences. To effectively serve users in multiple languages or regions, search engines require clear signals about your content.
This guide explores what is hreflang, an indispensable tool in international search engine optimisation. You will learn what are hreflang tags and discover their hreflang tags meaning, providing a solid foundation for optimising your online presence for a worldwide audience. This knowledge is fundamental for successful hreflang SEO.
What Is Hreflang?
When you publish content online, you often target a specific language or a particular geographical area. However, many websites offer their content in several languages or have different versions tailored for various regions speaking the same language.
This is where hreflang plays a pivotal role. At its core, hreflang is an HTML attribute used to inform search engines, primarily Google, about the language and geographical targeting of a webpage. It signals that certain pages are alternative versions of each other, designed for different audiences.
The primary purpose of hreflang attributes and tags is to prevent duplicate content issues in search results and ensure users land on the most appropriate version of a page. For example, if you have a product page for English speakers in the United States and another for English speakers in the United Kingdom, hreflang helps Google present the correct version to the right user.
Without this explicit instruction, search engines might see these similar pages as duplicates, which could negatively impact their ranking. Instead, hreflang empowers search engines to serve the most relevant content, thereby enhancing the user experience and improving search engine optimisation performance for international sites.
It clarifies the relationship between different language or region-specific versions of the same content.
How To Construct A Hreflang Tag
Constructing an hreflang tag involves specific syntax that informs search engines about the language and, optionally, the region your content targets. This tag typically resides within the <head> section of your HTML document, or it can be declared in an XML sitemap or HTTP headers. Understanding its structure is fundamental to correct implementation.
A Basic Hreflang Tag Follows This Format:
<link rel=”alternate” hreflang=”language_code-region_code” href=”URL_of_the_alternate_page” />
Let’s dissect each part of this structure:
link rel=”alternate”: This part signifies that the linked document is an alternative version of the current page. It is a standard HTML attribute for indicating relationships between documents.
hreflang=”language_code-region_code”: This forms the fundamental element of the hreflang attribute. It specifies the language and, optionally, the region for which the alternate URL is intended.
language_code: This must be an ISO 639-1 alpha-2 language code. For instance, en for English, fr for French, de for German, zh for Chinese. You must always specify the language.
region_code (optional): This represents an ISO 3166-1 alpha-2 country code. You use this when you target a specific region within a language group. For instance, the en-US designation is for English speakers in the United States, whereas en-GB is for English speakers located in Great Britain.
Using a region code helps differentiate content for users who speak the same language but reside in different geographical areas, perhaps due to variations in spelling, currency, or local product availability.
It’s important to note that you cannot specify a region without also specifying a language. For example, hreflang=”US” is invalid; it must be hreflang=”en-US”.
href=”URL_of_the_alternate_page”: This provides the absolute URL of the alternative version of the page being referenced. This URL must be fully qualified, including the protocol (e.g., https://).
Detailed Breakdown Of Optional Locale Targeting
The flexibility to target by language only, or by language and region, offers precise control over how search engines deliver your content.
Language-Only Targeting
If your content is in a specific language but serves a global audience for that language, you use only the language code. For example, hreflang=”es” would target all Spanish speakers, regardless of their location.
This is suitable for content that does not require regional customisation beyond the language itself.
Language And Region Targeting
When content varies significantly by country, even if the language is the same, combining language and region codes becomes necessary. Consider a global e-commerce brand:
A page for French speakers in France: hreflang=”fr-FR”
A page for French speakers in Canada: hreflang=”fr-CA” This precise targeting ensures that users receive the most relevant pricing, product availability, and local terminology.
Without this distinction, a French-speaking user in Canada might be served content meant for France, leading to a poor user experience.
Correctly constructing these tags is the first step in successful hreflang SEO. It lays the groundwork for search engines to recognise and serve the appropriate content versions to the correct users, thereby optimising visibility and user satisfaction across different linguistic and geographical segments.
What To Include In Hreflang Tags
When you implement hreflang tags, the core components are the language and optional region codes, followed by the absolute URL of the alternate page. Adhering to the correct format for these codes is paramount for search engines to properly interpret your signals.
Errors in these codes can render your hreflang implementation ineffective, potentially harming your international hreflang SEO efforts.
Focus On ISO Codes
The standardisation of language and region codes originates from the International Organisation for Standardisation (ISO).
Regarding Language Codes (ISO 639-1 Alpha-2)
You must specify the language using a two-letter ISO 639-1 language code. These codes are universally recognised and ensure clarity for search engines. Examples include:
- en for English
- de for German
- fr for French
- ja for Japanese
- ko for Korean
- zh for Chinese (simplified or traditional, often further specified by region)
Region Codes (Iso 3166-1 Alpha-2)
If your content targets a specific country or region in addition to a language, you append a two-letter ISO 3166-1 country code after the language code, separated by a hyphen. This part is optional but highly recommended when regional variations exist. Examples include:
- en-US for English in the United States
- en-GB for English in Great Britain
- fr-CA for French in Canada
- es-MX for Spanish in Mexico
- de-AT for German in Austria
It is important to remember that you cannot use a region code without a corresponding language code. For instance, hreflang=”SG” (for Singapore) is incorrect because it lacks a language. It should be hreflang=”en-SG” if targeting English speakers in Singapore, or hreflang=”zh-SG” for Chinese speakers in Singapore, and so forth.
Correctly applying these ISO codes in your hreflang tags provides precise instructions to search engines about the specific audience for each version of your content. This accuracy improves the likelihood that search engines will present the most relevant pages to users globally, directly impacting the effectiveness of your international SEO strategy and the meaning of hreflang tags meaning for search engines.
Example: Multiple Hreflang Tags For One Language
While hreflang often distinguishes between different languages, it is also frequently used to specify different versions of content within the same language, but for distinct regions. This scenario highlights the power of combining language and region codes to serve highly localised content.
Consider a retail website that offers products in English but has different pricing, product availability, and localisations for users in the United States, the United Kingdom, and a generic English-speaking audience not tied to a specific country. For a specific product page, say /product-page-123, the hreflang implementation would look like this:
Original Page (Example: US Version): https://www.example.com/us/product-page-123 (targeting English speakers in the United States)
UK Version: https://www.example.com/uk/product-page-123 (targeting English speakers in the United Kingdom)
Generic English Version: https://www.example.com/en/product-page-123 (targeting English speakers globally without a specific country preference)
For each of these pages, you must include a set of hreflang tags that reference all other available language/region versions, including a self-referencing tag for the page itself. This reciprocal linking is a fundamental rule of hreflang implementation.
Let’s look at the hreflang tags that would appear in the <head> section of https://www.example.com/us/product-page-123:
HTML
<link rel=”alternate” hreflang=”en-US” href=”https://www.example.com/us/product-page-123″ /><link rel=”alternate” hreflang=”en-GB” href=”https://www.example.com/uk/product-page-123″ /><link rel=”alternate” hreflang=”en” href=”https://www.example.com/en/product-page-123″ /><link rel=”alternate” hreflang=”x-default
” href=”https://www.example.com/en/product-page-123″ />
And similarly, for https://www.example.com/uk/product-page-123, the tags would be:
HTML
<link rel=”alternate” hreflang=”en-US” href=”https://www.example.com/us/product-page-123″ /><link rel=”alternate” hreflang=”en-GB” href=”https://www.example.com/uk/product-page-123″ /><link rel=”alternate” hreflang=”en” href=”https://www.example.com/en/product-page-123″ /><link rel=”alternate” hreflang=”x-default” href=”https://www.example.com/en/product-page-123″ />
Finally, for https://www.example.com/en/product-page-123, the tags would be:
HTML
<link rel=”alternate” hreflang=”en-US” href=”https://www.example.com/us/product-page-123″ /><link rel=”alternate” hreflang=”en-GB” href=”https://www.example.com/uk/product-page-123″ /><link rel=”alternate” hreflang=”en” href=”https://www.example.com/en/product-page-123″ /><link rel=”alternate” hreflang=”x-default” href=”https://www.example.com/en/product-page-123″ />
Why Is Hreflang Important For SEO?

The relevance of hreflang extends far beyond simply informing search engines about language versions. It plays a significant role in international search engine optimisation, directly influencing how your content performs in global search results.
Neglecting proper hreflang implementation can lead to significant issues, while correct use provides substantial benefits. This is why understanding what is hreflang in SEO is so important.
Benefits For International SEO
Hreflang provides several compelling advantages for websites targeting audiences across different languages and regions:
Correct Language Targeting
The primary benefit is ensuring search engines present the correct language or regional version of your page to the appropriate user. Imagine a user in Malaysia searching for a product.
If your site has a version tailored for English speakers in Malaysia and another for English speakers in Australia, hreflang guides Google to show the Malaysian version to the Malaysian user.
This precision means visitors land on content most relevant to them, whether it is their preferred language, local currency, or regionally specific product information. Such provides a positive user experience.
Avoiding Duplicate Content Issues
Without hreflang, pages with very similar content but different URLs (e.g., example.com/en-us/page and example.com/en-gb/page) might be perceived by search engines as duplicate content. Search engines generally try to avoid showing multiple identical results for the same query, which can lead to one or both of the similar pages being de-prioritised in search results.
Hreflang explicitly tells search engines that these pages are not duplicates, but rather alternative versions serving different audiences. This clarification prevents search engines from mistakenly penalising your site for perceived duplication, thus protecting your search rankings. This is a fundamental aspect of hreflang SEO.
Improving User Experience
When users find content in their native language and relevant to their geographical location, their experience on your website improves significantly. This reduces bounce rates, increases engagement, and encourages longer site visits.
If a user lands on a page meant for a different region (e.g., seeing prices in a foreign currency or irrelevant product variants), they are likely to leave, leading to a poor experience. Hreflang directly addresses this by directing users to the most suitable version of your content, leading to higher satisfaction and better engagement metrics, which search engines observe and value.
Increasing Search Rankings And Visibility
By enabling search engines to serve the right content to the right user, hreflang directly supports your international search rankings. When search engines accurately understand the relationship between your localized pages, they can confidently rank each version for its intended audience.
This precision enhances the visibility of your content in specific international markets. For instance, a German version of your website becomes more likely to rank well for German search queries in Germany, while an English version optimised for Singapore is more likely to appear for relevant searches originating there.
This targeted ranking boosts your organic reach and can lead to increased qualified traffic from various international markets. Proper hreflang SEO signals are key to achieving this improved visibility. In essence, hreflang acts as a clear communication channel between your website and search engines, ensuring that your global content strategy is accurately interpreted and effectively delivered to your diverse international audience.
This ensures your hreflang tags’ meaning is properly conveyed, leading to better international organic performance.
How To Implement Hreflang?

Implementing hreflang correctly is as important as understanding its purpose. There are three primary methods for implementing hreflang, each suited to different website architectures and content types.
Regardless of the method you choose, remember the reciprocal linking rule: every page that uses hreflang must include a set of hreflang tags that reference all other available language/region versions, including a self-referencing tag back to itself.
This ensures that the relationship between all alternative pages is clear to search engines.
Implementing Hreflang In Html (<Link> Tags In The <Head>)
This is the most common and often the simplest method for implementing hreflang for HTML pages. You place the hreflang tags within the <head> section of each page.
How It works: For every language or regional version of a page, you add a separate <link> tag within the <head> section. Each tag points to one of the alternative versions, including the page itself.
Example:Suppose you have an English page for Singapore at https://www.example.com/sg/en/page-name, and a Malay page for Singapore at https://www.example.com/sg/ms/page-name.
On the English page (https://www.example.com/sg/en/page-name), your <head> section would include:
HTML
<head> <title>Page Title – English (Singapore)</title> <link rel=”alternate” hreflang=”en-SG” href=”https://www.example.com/sg/en/page-name” /> <link rel=”alternate” hreflang=”ms-SG” href=”https://www.example.com/sg/ms/page-name” /> <link rel=”alternate” hreflang=”x-default” href=”https://www.example.com/sg/en/page-name” /></head>
And on the Malay page (https://www.example.com/sg/ms/page-name), your <head> section would include:
HTML
<head> <title>Tajuk Halaman – Bahasa Melayu (Singapura)</title> <link rel=”alternate” hreflang=”en-SG” href=”https://www.example.com/sg/en/page-name” /> <link rel=”alternate” hreflang=”ms-SG” href=”https://www.example.com/sg/ms/page-name” /> <link rel=”alternate” hreflang=”x-default” href=”https://www.example.com/sg/en/page-name” /></head>
Pros: Relatively easy to implement for small to medium-sized websites, visible directly in the page source.
Cons: Can make the <head> section quite large if you have many language/region versions, requires modifying every single HTML page.
Implementing Hreflang In XML Sitemaps
This method is particularly efficient for large websites with numerous language and regional versions, as it centralises all hreflang information in one or more XML sitemap files. Search engines read these sitemaps to discover new content and understand relationships.
How It works: Within your XML sitemap, you add <xhtml: link> elements for each URL. Each <loc> entry for a page will have a set of <xhtml: link> elements pointing to all its alternate versions.
Example Structure: Your sitemap (sitemap.xml) might look something like this:
XML
<?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://www.example.com/sg/en/page-name</loc> <xhtml:link rel=”alternate” hreflang=”en-SG” href=”https://www.example.com/sg/en/page-name” /> <xhtml:link rel=”alternate” hreflang=”ms-SG” href=”https://www.example.com/sg/ms/page-name” /> <xhtml:link rel=”alternate” hreflang=”x-default” href=”https://www.example.com/sg/en/page-name” /> </url>
<url> <loc>https://www.example.com/sg/ms/page-name</loc> <xhtml:link rel=”alternate” hreflang=”en-SG” href=”https://www.example.com/sg/en/page-name” /> <xhtml:link rel=”alternate” hreflang=”ms-SG” href=”https://www.example.com/sg/ms/page-name” /> <xhtml:link rel=”alternate” hreflang=”x-default” href=”https://www.example.com/sg/en/page-name” />
</url>
</urlset>
Pros: Centralised management, highly scalable for large sites, reduces HTML file size.
Cons: Requires knowledge of XML sitemap structure; changes only take effect after search engines
recrawl the sitemap.
Implementing Hreflang In Http Headers (For Non-Html Files)
This method is specifically useful for non-HTML files, such as PDFs or other document types, where you cannot place <link> tags in a <head> section. Your server must be configured to send hreflang information within the HTTP response header for each URL.
How It Works: When a server responds to a request for a page, it sends back HTTP headers along with the content. You can add a Link header that contains the hreflang information.
Example HTTP Header: For https://www.example.com/sg/en/document.pdf and its Malay alternative https://www.example.com/sg/ms/document.pdf, the HTTP header for the English PDF would look like this:
Link: <https://www.example.com/sg/en/document.pdf>; rel=”alternate”; hreflang=”en-SG”, <https://www.example.com/sg/ms/document.pdf>; rel=”alternate”; hreflang=”ms-SG”, <https://www.example.com/sg/en/document.pdf>; rel=”alternate”; hreflang=”x-default”
Each URL and its hreflang attribute are enclosed in <> and followed by rel=”alternate”; hreflang=”code”. Multiple entries are separated by a comma.
Pros: Applicable to any file type, server-side control.
Cons: Requires server configuration knowledge (e.g., .htaccess for Apache, Nginx configuration), more complex to implement and manage than HTML tags for HTML pages.
Choosing the right implementation method depends on your website’s nature and your resources. For most websites, a combination of HTML tags and XML sitemaps works well. HTTP headers become the necessary choice for non-HTML content. Correctly implementing what are hreflang tags through these methods is fundamental to your international hreflang SEO success.
The Difference Between Hreflang And Canonicalization
While both hreflang and canonical tags are fundamental tools in search engine optimisation, particularly for managing multiple versions of content, they serve distinct purposes.
Confusing their roles or misusing them together can send conflicting signals to search engines, potentially harming your site’s visibility. Understanding what is hreflang in relation to canonicalisation is key for an effective international SEO strategy.
Understanding Canonical Tags
A canonical tag (<link rel=”canonical” href=”URL” />) is an HTML element that specifies the “master” or “preferred” version of a set of duplicate or very similar pages. Its primary purpose is to address duplicate content issues within a single language or region.
Consider these scenarios where canonical tags are useful:
Identical Content On Multiple URLs: Your website might generate several URLs that lead to the same content. For instance:
https://www.example.com/product
https://www.example.com/product?sessionid=abc
https://www.example.com/product?source=email All these URLs display the same product page. A canonical tag tells search engines, “Among these options, https://www.example.com/product is the one you should index and rank.”
Content Accessible Via Different Paths: A product might appear in multiple categories, leading to different URLs like:
https://www.example.com/shoes/running-shoes/nike-air
https://www.example.com/nike/running-shoes/nike-air :The canonical tag on both these pages would point to one designated “master” URL, ensuring search engines consolidate ranking signals to that single version.
Printer-Friendly Pages Or Mobile Versions (non-responsive design): If you have a separate URL for a printer-friendly version of a page or a dedicated mobile version (in a non-responsive setup), the canonical tag should point to the main, desktop version.
Syndicated Content: If you syndicate your articles to other websites, they should ideally include a canonical tag pointing back to your original article to ensure your site receives the SEO credit.
In essence, a canonical tag is an “exclusionary” signal. It tells search engines, “Do not index this page; instead, index that (canonical) page.” It consolidates ranking signals from duplicate pages onto a single URL, preventing diluted authority and ensuring only one version appears in search results.
Understanding Hreflang Tags
As we have discussed, hreflang tags (<link rel=”alternate” hreflang=”language-code” href=”URL” />) communicate the language and regional targeting of alternative versions of content.
Its primary purpose is to help search engines serve the most appropriate version of a page to users based on their language and location settings.
Key Points About Hreflang
Language And Region Specificity: Hreflang defines relationships between pages that are different by language or region, even if the core message is similar. For example, a page in English for the US (en-US) and the same page translated into Spanish for Mexico (es-MX).
Inclusionary Signal: Unlike canonicals, hreflang is an “inclusionary” signal. It tells search engines, “Index this page, and also index these other pages because they are valid alternatives for different audiences.” It does not de-index pages; it helps distribute them correctly to international searchers.
Bidirectional: Hreflang tags work in sets. If page A points to page B with hreflang, page B must also point back to page A with hreflang. To enable search engines to confirm the relationship, this reciprocal linking proves fundamental.
Self-Referencing: Every page that contains hreflang attributes must likewise possess a self-referencing hreflang tag pointing to its URL.
When To Use Hreflang Vs. Canonical Tags

Choosing between hreflang and canonical tags depends entirely on the nature of your content variations and your SEO goals.
Use Hreflang When:
- You have distinct pages for different languages (e.g., English, Spanish, French versions of your homepage).
- You have pages in the same language but targeted at different regions (e.g., English for the US vs. English for the UK due to spelling, pricing, or product variations).
- You want all these different language/region versions to be indexed and discoverable by their respective target audiences.
- Your goal is to guide international users to the most appropriate version of your content based on their location and language preferences. This is paramount for strong hreflang SEO.
Use Canonical Tags When:
- You have multiple URLs that serve the same or very nearly identical content to the same target audience.
- You are dealing with URL parameters (e.g., tracking codes, session IDs) that create multiple URLs for a single piece of content.
- You have a product that appears under multiple categories, resulting in different URLs.
- You have a printer-friendly version of a page.
- You aim to consolidate the SEO authority of these duplicate URLs into a single, preferred version.
Using Hreflang And Canonical Tags Together
It is not a matter of choosing one or the other; in many international SEO scenarios, you should use both hreflang and canonical tags in conjunction. This is a common point of confusion when learning what hreflang is in SEO.
The Best Practice
Each page that is part of an hreflang cluster (i.e., has alternative language/region versions) should generally have a self-referencing canonical tag. This signifies that the canonical tag on a page points to its URL.
Why Self-Referencing Canonicals Are Important With Hreflang
If you have https://www.example.com/en-us/page (English US) and https://www.example.com/en-gb/page (English UK), both pages should have:
Hreflang Tags
Listing themselves and all other alternatives (e.g., en-US pointing to en-US, en-GB pointing to en-GB, etc.). This tells Google these are alternatives for different locales.
Self-Referencing Canonical Tag
The en-US page has a canonical tag pointing to https://www.example.com/en-us/page. The en-GB page has a canonical tag pointing to https://www.example.com/en-gb/page.
This combination sends clear, consistent signals:
The canonical tag tells search engines, “This specific URL is the preferred version of this particular language/region’s content.”
The hreflang tags then tell search engines, “And by the way, here are its counterparts for other languages and regions.”
A Critical Error To Avoid
Never have a page with a hreflang tag that also has a canonical tag pointing to a different URL in a different language or region. For example, do not have your en-GB page canonicalise to your en-US page if you want both en-GB and en-US versions to be indexed.
This creates conflicting signals: hreflang says “index both as alternatives,” while canonical says “only index the US version and ignore the GB version.” Search engines will likely ignore your hreflang signals if they conflict with your canonicals in this way.
Properly aligning your hreflang and canonical strategies ensures that search engines both understand the intended audience for each version of your content and avoid any confusion regarding duplicate pages, which is essential for comprehensive and effective hreflang SEO. This detailed comparison helps to clarify the precise hreflang tags meaning in the context of broader site optimisation.
Conclusion On Hreflang For Global Reach
Implementing hreflang tags is a powerful, precise strategy for optimising your website for international audiences. This guide explained what is hreflang, detailing its syntax, the importance of accurate ISO codes, and how to construct complex sets for multiple regional variations within a single language.
We have also explored why is hreflang important for SEO, covering its role in preventing duplicate content issues and significantly improving user experience. By understanding the distinct purposes of hreflang and canonical tags, you can ensure search engines correctly interpret your content relationships.
Proper hreflang SEO empowers your site to connect with users globally, delivering relevant content and enhancing your online presence effectively.
Check out the BestSEO website today for more information on how websites work.
Frequently Asked Questions About Hreflang Tags
What Is The Primary Benefit Of Using Hreflang?
The main benefit of using hreflang is to ensure search engines show the correct language or regional version of your content to the appropriate user, thereby improving user experience and preventing duplicate content issues across different locales.
How Often Should I Audit My Hreflang Implementation?
Regular audits are highly recommended, ideally quarterly or whenever significant changes occur on your website, such as adding new language versions or restructuring URLs, to identify and rectify any errors that could impact your international SEO performance.
Is It Possible To Use Hreflang For Content That Is Merely Translated, Or Solely For Content That Is Geographically Different?
You can use hreflang for both. It is essential for content that is simply translated into different languages, and also for content in the same language but adapted for specific regions (e.g., English for the US versus English for the UK).
Does Hreflang Pass Along “Link Equity” Or “Ranking Power” Between Pages?
No, hreflang does not directly pass “link equity” or “ranking power” in the way a 301 redirect or canonical tag does. Its purpose is to signal to search engines that alternative versions of a page exist for different audiences, helping them serve the most relevant content, rather than consolidating ranking signals.