Hreflang In SEO – How To Implement It (Ultimate Guide)

Share on:

Hreflang is a language and region code protocol used to specify language and geographical targets of a web page.

It is part of the search engine optimization (SEO) guidelines that help Google, Bing and Yahoo understand your site’s content better.

To rank in the desired market(s), it’s vital to implement hreflang tags on your international pages correctly.

Hreflang In SEO - How To Implement It (Ultimate Guide)

This means not only placing them in HTML <head> section but understanding how they work, making sure you add them when necessary and checking if they aren’t causing any errors or problems with crawling/indexing/rendering.

In this guide we will cover all important aspects of using Hreflang tags for SEO, including

And much more…

1. What is hreflang?

Hreflang annotations are code snippets in the <head> section of your page that signal Google, Bing and Yahoo! about the language and geographical targeting of a web page or set of pages on an international website.

They help search engines correctly show users the intended version of a page by informing them whether it’s available in their preferred language/geo-targeting combination(s).

Also Read:  Why Do People Not Go To Second Page Of Google Search?

Hreflang annotations on multi-language websites indicate which pages have equivalents in other languages so they can be indexed and ranked accordingly without showing results for irrelevant searches.

The protocol also helps with content translation to provide localized experiences for speakers of other languages on your site.

2. How do hreflang annotations work?

Hreflang is a self-referencing system that uses the URL of the page to tell search engines which language/region variants it can serve.

It requires creating separate pages for each translation.

These are then linked with

<a href=”” hreflang=”x”>English version</a>

or using HTTP header response codes (most commonly 302).

How Google handles hreflang tags in HTML tag <head>.

It shows geographical targeting only when the site has regional variations, while region targeting shown alongside language code for multilingual sites.

All international versions of your website need to be accessible from the HTTP header response code on the initial machine.

This means creating separate hreflang entries for each subdomain, folder or directory, so search engines know which pages are available in which languages/regions.

3. Types of hreflang annotations

You can implement hreflang using one of three methods: HTML markup in page <head>, HTTP header response code or Sitemap file.

The protocol requires adding language and geographical targeting information to all relevant international pages even if they’re identical to the original site.

Also Read:  19 Thing's Must Follow to Do Before Writing Blog Post


important not to mix these variants within a single page because it may trigger crawling errors or worse – cause indexing issues with some versions of your website while others rank fine.

We recommend creating separate URLs for every language/region variant you have.

If a page is available in multiple languages, it must contain hreflang annotations for all of them.

3.1 HTML <head> section implementation

A single URL can support multiple locales by listing all supported translations within the

<link rel=”alternate” href=”” hreflang=”x-default”> tag (indicating default locale).

For example:

<link rel=”alternate” href=”” hreflang=”en-US”/>

<link rel=”alternate” href=”” hreflang=”en-UK”/>

<link rel=”alternate” href=”” hreflang=”en-AU”/>

In case when a single page is available in several languages but it’s not identical to the original site, you can implement reference using a tag named “x-default”.

In this scenario you need to include only the URL of the default variant and set its attribute according to geographical location:

<link rel=”alternate” href=”” hreflang=”en-US” x-default />

<link rel=”alternate” href=”” hreflang=”en-UK” x-default />

<link rel=”alternate” href=”” hreflang=”en-AU” x-default/>

3.2 HTTP header response code annotation

Another way to implement the protocol is by adding a location tag to the HTTP header response code of your international page variants: …

In this case, search engines will see regional targeting only if a geotargeting parameter exists in the URL path or HTTP headers for the page in question.

Also Read:  Eight Efficient Backlink-Constructing Practices You Must Know

3.3 Sitemap file annotation

Last but not least you can add hreflang tags to your XML sitemaps:

<url> <loc></loc> <xhtml:link rel=”alternate” href=”″ hreflang=”en-UK”/> </url>

If a URL does not include geographic location, search engines will use the information from the default locale (indicated by xhtml:link ).

You should note that if you’ve implemented multiple types of annotations for a single URL, we strongly recommend using the HTTP header response code.

This is due to the fact that HTML <head> section implementation might confuse some search engines, while sitemap file usage has been reported as a duplicate content issue by Google.

In case if you add multiple hreflang links for one page, it may cause incorrect or no crawling at all in some cases.

The best way to implement this standard is adding alternate links with different languages/regions only but not mixing them on one page.

How does hreflang work?

After implementing hreflang annotations according to your needs, you’ll be able to control how search engines crawl and index your international pages.

The protocol operates through link elements that point webmasters’ attention towards their own sites.

This gives an advantage to multi-lingual content publishers who want to get their pages indexed correctly everywhere they are available.

Also Read:  SEO Trick: How To Identify Good Backlinks [Important]

Google has recently implemented hreflang annotations in Webmaster Tools through local versions report, which helps you identify the number of page variations translated into various languages within your site.

By checking this data, webmasters can easily detect non-indexed or incorrectly crawled pages and fix errors if any.

If you’re looking for more information on how to create proper hreflang annotations or just additional resources to that topic please check our blog post about sitemap usage . Happy crawling!

Leave a Comment