6869
How-to 6 min read September 26, 2019

Errors in hreflang attributes: what are they and how to fix them

Problems with hreflang are mainly caused by typos, the use of incorrect codes and non-existent links. If there are errors, the crawler ignores this attribute.

Common hreflang attribute errors

1
Invalid format. The language code is indicated first, and then the region code is specified. To determine the code, you need to use the language ISO 639-1 and the regional ISO 3166-1 Alpha 2 standards. Before implementing an attribute, it is important to verify that the link format complies with the specified standards.

For example, you need to create a page for English-speaking citizens living in the United States. Using the "en-us" format is correct. For English-speaking citizens from the UK, the correct sequence is "en-gb," but not "en-uk." According to the rules of setting the attribute, the language must be specified, and the region may be completely absent.

In some links, only the region is found, and this is wrong. It is allowed to use the only language so that the page is displayed to people who speak a specific language, but are located anywhere in the world.
2
Separation of language and region using dashes or underscores. The only correct option is to use a hyphen. For example, "en-us" is correct, and "fr_uk" is incorrect.
3
Conflicts in the attribute code. Setting up hreflang involves using a single page for one language. In other words, one language version corresponds to a single URL in the code. Multiple pages cannot be written in one language.

In the example, the English version is used for all pages. This is an error:
Conflicts in hreflang attribute code
4
Typos. For example, instead of "fr" which stands for France, "fi" is used which means Finland. However, the page content is written in French. This page will not be indexed by the search engine. To avoid such errors, use the hreflang tag generator.
5
Hreflang attributes with errors in links:

  • links direct to pages that do not exist. When clicking on the URL, an error 4xx or 5xx is shown;
  • lacking a specific hreflang element. If a language version exists, but no attribute has been created for it;
  • the ones redirect to another page. In this case, the second URL is not indexed;
  • without full indication of their components. We are talking about the so-called relative links with the missing first part.
Incorrect: /catalog1/file1.html
Correct: http://site.com/catalog1/file1.html
6
Lack of backlinks. Problems with hreflang occur in the absence of return confirmative links to the attribute. If page 1 refers to page 2, then page 2 must have a backlink to page 1.
Any of these errors on a specific page leads to the fact that it will not be indexed by a search engine robot.

How to find and fix hreflang errors

You will have to revise the hreflang attribute code yourself to detect errors in writing letters and hyphens and check the correspondence of languages and regions. Use the Screaming Frog service to determine the mismatch of one language version to a single page:
Validating the hreflang attribute in Screaming Frog
The absence of backward supporting links is also checked manually. Non-existent URLs and redirects are easily detected using an online tool, for example, the Site Audit module in Serpstat.

What you need to do to prevent errors:

1
Use absolute links instead of relative ones.
2
Each time you add the hreflang attribute, check the data for compliance with the standards.
3
Delete URLs displaying 4xx or 5xx error codes and redirect pages.
4
Determine what is more important for the website: user language or region. In the first case, do not use the location indication, and specify the language and country in the second one.

Conclusion

The problems with the hreflang attribute are mainly caused by:

  • errors in specifying languages and regions according to the standards;
  • using nonexistent links and redirects;
  • lack of backlinks to pages with the attribute;
  • the order of specifying the component links with the hreflang attribute;
  • specifying multiple pages for one language version.

To find the hreflang attributes with errors and fix them, you need to conduct a small audit of the pages and adjust everything that does not comply with the rules for setting up sites with several language versions.
This article is a part of Serpstat's "Site Audit" tool
SEO Audit in Serpstat" title = "Errors in hreflang attributes: what are they and how to fix them 16261788343836" />
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

Speed up your search marketing growth with Serpstat!

Keyword and backlink opportunities, competitors' online strategy, daily rankings and SEO-related issues.

A pack of tools for reducing your time on SEO tasks.

Get free 7-day trial

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

Discover More SEO Tools

Tools for Keywords

Keywords Research Tools – uncover untapped potential in your niche

Serpstat Features

SERP SEO Tool – the ultimate solution for website optimization

Keyword Difficulty Tool

Stay ahead of the competition and dominate your niche with our keywords difficulty tool

Check Page for SEO

On-page SEO checker – identify technical issues, optimize and drive more traffic to your website

Share this article with your friends

Are you sure?

Introducing Serpstat

Find out about the main features of the service in a convenient way for you!

Please send a request, and our specialist will offer you education options: a personal demonstration, a trial period, or materials for self-study and increasing expertise — everything for a comfortable start to work with Serpstat.

Name

Email

Phone

We are glad of your comment
I agree to Serpstat`s Privacy Policy.

Thank you, we have saved your new mailing settings.

Report a bug

Cancel
Open support chat
mail pocket flipboard Messenger telegramm