top of page
  • Writer's pictureBrent Payne

Mismatched hreflang and HTML lang declarations

The page you are viewing seems to have hreflang tags and HTML lang attributes that are conflicting or not aligned.


Why is this important?

Certain search engines such as Bing rely on the HTML lang attribute to display content to the appropriate regional audience. Conversely, search engines like Google and Yandex use hreflang tags for this purpose.


When there's a discrepancy between hreflang and HTML lang, it indicates a mistake has occurred within the hreflang annotation, the HTML lang, or both. This could lead to showing an incorrect version of the page in search results targeting specific regions.


What does the Optimization check?

The Optimization activates when any URL is detected to have mismatching hreflang annotations and HTML lang attributes.


Examples that trigger this Optimization:

Take as an example the URL: https://example.com/en/page-a/


If the following HTML lang attribute is on the page:

<html lang="en-GB">


and it is accompanied by a conflicting hreflang link element like so:

<link rel="alternate" href="https://example.com/en/page-a/" hreflang="en-US" /><link rel="alternate" href="https://example.com/fr/page-a/" hreflang="fr-FR" /><link rel="alternate" href="https://example.com/de/page-a/" hreflang="de-DE" />


How do you resolve this issue?

When HTML lang causes problems in search engines that accept it (e.g., Bing), those search engines might not present the right content for different regions. Likewise, incorrect hreflang impacts search engines that use hreflang (e.g., Google).


Resolving this issue may involve a manual review of the page content to discern which attribute is incorrect. Subsequently, adjustments should be performed on the pages or the scripts that generate these language tags.


Further Reading

3 views

Recent Posts

See All

ClubReq Gets A Link (Because They Asked)

I am a mentor for Techstars and have been for over 10 years. In those ten years I have mentioned to startups to ask ANYONE and everyone that they meet to link to their site. Yet, in all those times on

Comments


bottom of page