Sign in Sign Up

This site uses cookies and other tracking technologies to make possible your usage of the website, assist with navigation and your ability to provide feedback, analyse your use of our products and services, assist with our promotional and marketing efforts, and provide better user experience.

By using the website, you agree to our Privacy policy

Report a bug

How-to 11 min read October 2, 2019

How to detect conflicts of hreflang attributes in the page code and resolve them

The hreflang attribute helps a search engine to identify the version of a web page that matches the language and region of a user and display it in the search results. However, conflicts may occur when using hreflang attributes resulting in incorrect search results.
A website with several language versions is not a unique attribute of large-scale international projects such as hotel or airline reservation services. Currently, the number of relatively small online stores is growing, which want to expand their target audience and enable visitors to choose the appropriate language in the website's functionality.

This applies not only to the English version of a website. For example, in Ukraine, where two languages (Russian and Ukrainian) are widespread, the appropriate language options are a necessary attribute of a quality website.

Advantages of setting up a multilingual website

Hreflang attributes and SEO

Using hreflang affects the indexing of web pages and also helps a search engine to identify similar pages as separate language versions rather than duplicated content. This is especially important when using similar languages, for example, Russian and Belarusian or English for residents of Canada and the United States. Using these attributes, a search engine recognizes the linguistic and regional structure of a resource.

Hreflang tells a search engine that the page with the translated content is an alternative to the original one and not its duplicate. As you know, duplicated content negatively affects the website ranking. Hreflang tags and attributes will help to solve this issue for websites with different regions or different language versions in the same region.

Convenience for users

The multilingualism of a website affects behavioral factors. If a user gets to a transregional website and has an opportunity to choose their native language, they stay there much longer. The presence of language versions reduces bounce rate, increases the average session duration, as well as the number of pages viewed which is the number of pages per session.

Increasing profits

When a user gets familiar with a web resource in a language that they understand, the likelihood of a conversion increases significantly. Often, different regions imply not only language differences, but also different currencies, prices, contact details, delivery terms, etc.

The use of several language versions and unique content in each of them positively affect the website indexing.

The hreflang attribute helps to avoid penalties for duplicated content, especially in cases where alternative pages contain text in the source language, for example, only in English, instead of the translated one. As for ranking, the main language version of the website is normally ranked higher in search results.

As a result, the website gets more targeted traffic from different regions. Thus, the main goal of multilingualism is to increase the number of conversions and revenue.

What if there are no hreflang attributes on a website

The search robot can recognize alternative web resource pages in different languages. However, it happens that an appropriate version of a website with translated content, for example, in Spanish, is created for the audience, but as a result of the search, a user gets to a page in English or another default language.

Specify the hreflang attributes to show the analogs of the pages of a web resource to a search engine. There are three different ways to configure language versions:

  • in website folders ( and;
  • on subdomains ( and;
  • on various domains ( and

There are also options of mixed implementation of multilingualism, for example, when language versions are placed in subfolders on different domains. In this article, we will not consider all the possible options and behavior of search engines in each case. We will focus on attribute conflicts and ways to avoid them.

How to use the hreflang attribute

With rel="alternate" hreflang="x" you can define existing page options. For example, the hreflang attribute indicating the use of English for the United States may look like this:
<link rel="alternate" hreflang="en-us" href="">
The en-us bundle is obtained by specifying a language code in the ISO 639-1 format and adding a region to it according to the ISO 3166-1 Alpha 2 country code system. This means that the page content is designed for English-speaking users in the United States.

It is not required to specify a region within hreflang. If you remove "us", this will mean that the page is designed for all English-speaking users in the USA, the UK, Australia, etc.
Hreflang attribute working scheme
Each hreflang attribute must include:

  • links to existing language options of the page;
  • the protocol http/https in the URL text.

Also, for the best implementation of multilingualism, you can specify a link that leads to itself in the page code. It is important that alternative language versions link back to the page.

For example, if hreflang is on from, and hreflang on the Russian version of ru is not on, then such hreflang is not taken into account by Google. The error "Hreflang — Missing return links" appears in Search Console.

In general, the hreflang attribute provides three main options for implementation.

HTML tags

In this case, the hreflang attributes are part of the page code. To use this method in HTML code, you should specify the <link> set of links in the <head> element at the top of the page. The same combination of links should be used in all variations of the original page.


The Sitemap.xml file helps to inform a search engine about the availability of alternative pages. To implement the method, you need the <loc> element and child tags <xhtml:link>. The first tag contains the URL of the main page: <loc></loc>. You need to place links that define the language and location within <xhtml: link>:
<xhtml:link rel="alternate" hreflang="ua" href="" />
<xhtml:link rel="alternate" hreflang="en" href="" />
As noted above, the hreflang attribute must contain a link to the source page. In this case, the page has two language versions — Ukrainian and English.

HTTP heading

This method is often used for documents that are not related to the HTML format. For example, on the restaurant website, there are two menu options in pdf — in local and English languages. Use hreflang to show both options to a search engine:
Link: <>;
rel="alternate"; hreflang="ua",
rel="alternate"; hreflang="en"

What is the Hreflang="x-default" value

Sometimes the user's browser language does not match any of the language versions of your website. In this case, the best option is to choose one of the default languages and direct a user to it. To do this, use the value hreflang="x-default".
link rel="alternate" hreflang="x-default" href=""

How to validate the hreflang attributes

When using hreflang, you need to make sure that the attributes are correctly applied and if there are any conflicts between hreflang and other code elements.

The previous version of Google Search Console included the "International Targeting" section for managing hreflang tags and specifying target regions. This function has not yet been transferred to the new interface.
Country and language targeting in the Google Search Console
You may find these tools useful for testing purposes:

Hreflang Tags Testing Tool

Conflicts of the hreflang attributes

When testing web pages, you may find that hreflang is misused. Conflicts of attributes with other code components often affect the process of crawling a website and its ranking. Let's consider the main ones.

No self-referential hreflang

This error indicates that an important condition for using hreflang is not met on one or several pages of a website which is a return link on the web page for a particular language.

Solution: include the link to the source page in the HTML document using the <link> element, or add it to the <xhtml:link> element of the sitemap. However, Google representatives noted that the hreflang self-referential link is "good practice", but this is optional and not mandatory.
Error No self-referencing hreflang

Conflicting hreflang URLs

A common cause of this problem is the incorrect page address syntax. You should remember that each URL within the hreflang attribute must be specified entirely and begin with the name of the HTTP or HTTPS protocol.

Solution: validate the URL correctness and make sure the HTTP/HTTPS protocol is specified in the address.

Conflicting hreflang and rel=canonical

The error indicates that the canonical link rel="canonical" is directed to a language version other than the original. The canonical link serves as a pointer to a search robot.

Alternative pages can be recognized as duplicated content, and the task of rel="canonical" is to indicate the priority language version and its analogs. The combination of hreflang and rel="canonical" attributes shows different options for a particular web page marking it as a priority for a search robot.

This error is not related directly to the hreflang setting, however, you should keep in mind that incorrect use of canonical links can mislead the search engine and cause indexing issues.

Solution: replace canonical links so that each leads to a language alternative to the respective web page.


Using hreflang attributes is a universal solution for transregional websites as well as resources with several language versions in one region.

Pointing to alternative pages to search engines affects the website ranking in the search results. Tracking hreflang conflicts in the resource page code and resolving them successfully will allow you to get the maximum effect from this attribute.
This article is a part of Serpstat's "Site Audit" tool
SEO Audit in Serpstat
Audit all the site or page in one click. A complete list of errors, sorted by severity, ways to resolve them and recommendations. Any frequency of verification and automatic email reports.
Run Site Audit

Learn how to get the most out of Serpstat

Want to get a personal demo, trial period or bunch of successful use cases?

Send a request and our expert will contact you ;)

Rate the article on a five-point scale

The article has already been rated by 0 people on average out of 5
Found an error? Select it and press Ctrl + Enter to tell us

Share this article with your friends

Sign In Free Sign Up

You’ve reached your query limit.

Or email
Forgot password?
Or email
Back To Login

Don’t worry! Just fill in your email and we’ll send over your password.

Are you sure?


To complete your registration you need to enter your phone number


We sent confirmation code to your phone number

Your phone Resend code Queries left

Something went wrong.

Contact our support team
Or confirm the registration using the Telegram bot Follow this link
Please pick the project to work on

Personal demonstration

Serpstat is all about saving time, and we want to save yours! One of our specialists will contact you and discuss options going forward.

These may include a personal demonstration, a trial period, comprehensive training articles & webinar recordings, and custom advice from a Serpstat specialist. It is our goal to make you feel comfortable while using Serpstat.




We are glad of your comment
Upgrade your plan

Upgrade your plan

Export is not available for your account. Please upgrade to Lite or higher to get access to the tool. Learn more

Sign Up Free

Спасибо, мы с вами свяжемся в ближайшее время

View Editing


You have run out of limits

You have reached the limit for the number of created projects. You cannot create new projects unless you increase the limits or delete existing projects.

I want more limits