Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:

You are using WPML and experiencing issues with AHREFS site audit when the 'Browser Language Redirect' feature is enabled, resulting in Hreflang and HTML lang mismatch errors.

Solution:

First, ensure that the HTML lang attribute matches the intended language, as seen in the page source (e.g., pt-br for Brazilian Portuguese). You can verify this by checking the page source directly. If the HTML lang and HREF lang are matching as expected, the issue might be related to the 'Browser Language Redirect' feature affecting Google Indexing. We recommend reviewing the following documentation for more details on how this feature impacts indexing:

If this solution does not resolve your issue or seems irrelevant due to being outdated or not applicable to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If problems persist, please open a new support ticket for further assistance.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 3 replies, has 2 voices.

Last updated by Bigul 3 months ago.

Assisted by: Bigul.

Author Posts
November 19, 2024 at 2:01 am #16417239

compliant-learning-resourcesP

Background of the issue:
We are using WPML and experiencing issues with AHREFS site audit when we enable the 'Browser Language Redirect' feature on our site hidden link.

Symptoms:
We are getting Hreflang and HTML lang mismatch errors on AHREFS site audit.

Questions:
Do you have any suggestion/s on how to fix the Hreflang and HTML lang mismatch errors?

November 20, 2024 at 7:27 am #16422402

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Hi there,

While waiting for one of my colleagues to help you, please review the following.

Visiting this page -> hidden link

I can verify that the HTML lang is matching pt-br and the HREF lang is correctly referencing.

Please see my screenshot.

You can also review the source directly here:
view-source:hidden link

Screen Shot 2024-11-19 at 11.25.24 PM.png
November 20, 2024 at 10:28 pm #16426640

compliant-learning-resourcesP

Hi, 'Browser Language Redirect' feature is currently disabled on our site since it causes errors on AHREFS site audit.

November 21, 2024 at 5:32 pm #16430507

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+01:00)

Hello,

Thank you for the updates. This is an expected result. Because when *Browser language redirect* the option is enabled, it may affect the Google Indexing. Please refer to following documentation for more details.

https://wpml.org/documentation/getting-started-guide/language-setup/automatic-redirect-based-on-browser-language/

https://wpml.org/documentation/getting-started-guide/language-setup/automatic-redirect-based-on-browser-language/how-browser-language-redirect-affects-google-indexing/

--
Thanks!

Bigul