Problems with hreflang are mainly caused by typos, the use of incorrect codes and non-existent links. If there are errors, the search robot ignores this attribute.
Common errors in the hreflang attribute
- Wrong format. The first is the language code and only then the region code. To determine the code, you must use the ISO 639-1 language and regional ISO 3166-1 Alpha 2 standards. Before introducing an attribute, it is important to verify that the format of the link meets the specified standards.
For example, you need to create a page for English-speaking citizens living in the United States. It will be correct to use the format “en-us”. For English-speaking citizens from the UK, the correct sequence is “en-gb”, but not “en-uk”. According to the rules for 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 only the language so that the page is given out to people who speak a specific language but are located anywhere in the world.
- Separate the language and region using a dash or underscore. The only correct option involves the use of a hyphen. For example, “en-us” is correct, and “fr_uk” is wrong.
- Conflicts in attribute code. Configuring hreflang means using a single page for one language. In other words, a single language version corresponds to a single URL in the code. Multiple pages can not be written in the same language. In the example, the English version is used for all pages. This is mistake:
- Typos in letters. For example, instead of “fr” – France is used “fi” – Finland. The content on the page is written in French. This page is not indexed by the search engine. To avoid such errors, use the hreflang tag generator.
- Attributes hreflang with errors in the links:
- on pages that don’t exist. Clicking on the URL gives an error 4xx or 5xx;
- with a shortage of a specific hreflang element. If the language version exists, but the attribute for it is not created;
- with redirect to another page. In this case, the second URL is not indexed;
- without full indication of its components. These are the so-called relative links with the missing first part.
- No backlinks. Problems with hreflang occur when there are no returnable supporting references to the attribute. If page 1 refers to page 2, on page 2 there should be a back link to page 1.
Any of these errors on a particular page leads to the fact that it will not be indexed by the search robot.
How to find errors in hreflang and fix them?
To detect errors in writing letters, hyphens, and checking the correspondence of languages and regions, it is necessary to revise the attribute code hreflang independently. To determine if a single language version of a single page does not match, use the Screaming Frog service:
What you need to do to prevent errors:
- Use absolute links instead of relative ones.
- Each time the hreflang attribute is added, check the data for compliance with the standards.
- Delete URLs that generate error codes 4xx or 5xx and redirect pages.
- Determine what is more important for the site: the language or region of the user. In the first case, do not use the location indication, in the second – indicate the language and country.
Problems with the hreflang attribute are mainly related to:
- errors in writing languages and regions according to standards;
- the use of non-existent links,
- redirects; lack of backlinks to pages with an attribute;
- the order of writing the constituent links with hreflang;
- 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 correct everything that does not comply with the rules for setting up sites with several language versions.