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

1 view0 comments

Recent Posts

See All

The skip-link target should exist and be focusable

At Loud Interactive, we're committed to ensuring that digital accessibility is at the forefront of website design and development. During our SEO audits, we look for and attempt to identify an area of

Timed meta refresh must not exist

At Loud Interactive, we regularly perform a SEO audits. We often stumble upon an important issue that could significantly impact user experience and accessibility on websites. We're talking about the

bottom of page