Skip Navigation

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

Problem:
The client's website is not generating the correct HTML language tag when using the WPML plugin.

Solution:
1. We recommend checking the theme's header.php file to ensure that the HTML lang tag is set properly. Look for the following code:

<html <?php language_attributes(); ?>></html>

2. If the code is correct, we suggest clearing the website's cache, particularly if using caching plugins like WP Rocket, and then testing the site again.

3. Another step is to switch to a default WordPress theme to see if the issue persists. This can help determine if the problem is theme-related.

Please note that the solution provided might be irrelevant due to being outdated or not applicable to your specific case. If the issue persists, we highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, please do not hesitate to open a new support ticket in the WPML support forum.

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 1 reply, has 2 voices.

Last updated by Marsel Nikolli 1 year, 3 months ago.

Assisted by: Marsel Nikolli.

Author Posts
March 6, 2024 at 8:42 am #15377742

gerbenv-7

Please see our website nautaconnect.com. We use the WMPL-plugin.

The HTML language tag is not generated. You can use this tool to check it: hidden link

Can you let me know how we can have WPML generate the correct HTML language tag?

March 6, 2024 at 9:48 am #15378253

Marsel Nikolli

Hi,

Thank you for contacting WPML Support, I will be happy to help you.

I noticed that there is no HTML lang tag on your default language as well.

Would it be possible to check your theme's header.php file and confirm that the HTML lang tag is set properly? You should check for something like this: <html <?php language_attributes(); ?>>

--

If the code is set correctly on your theme's header.php file, would it be possible to check if the issue persists after you clear your website's cache (using WP Rocket) and by switching to a default WP theme?

Looking forward to your reply,
Marsel

March 13, 2024 at 7:45 am #15402234

gerbenv-7

Thanks very much, Marsel. I guess the company who made our website should solve this. Thanks for pointing us in the right direction!