Skip Navigation

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

Problem:
The client is experiencing issues with incorrect hreflang tags for languages on their website, specifically with the Norwegian language code, which is incorrectly set as 'nb-nb' instead of the standard 'no'. This issue affects the website's SEO as hreflang tags are crucial for multilingual websites to signal the language and regional URL variations to search engines.
Solution:
We reviewed the source code of the client's website and identified that all languages except Norwegian were using the correct hreflang tags. The Norwegian language should use the standard 'no' code instead of 'nb-nb'. If the client has created a custom Norwegian language, we recommend switching to the default language settings provided by WPML, as the custom setting conflicts with the standard language codes. To update the language codes in WPML:
1. Navigate to the WPML > Languages page.
2. Under the 'Edit Languages' section, find the incorrect 'nb-nb' entry.
3. Replace 'nb-nb' with 'no' and save the changes.

If this solution does not resolve the issue or seems outdated, or if it does not apply to your specific case, please visit our support forum to open a new support ticket. We also 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.

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 4 replies, has 1 voice.

Last updated by Nicolas V. 2 weeks, 4 days ago.

Assisted by: Nicolas V..

Author Posts
November 14, 2024 at 10:41 am #16401657

erkkiM

Background of the issue:
I am trying to fix hreflang language issues on my website using the WPML plugin. The hreflang tag is generated by a multilingual plugin, not by the Yoast SEO plugin. I was advised to review a guide on hreflang and ensure the language codes are appropriate. I am using the WPML plugin and need help fixing the hreflang language issues. There should be a way to update the language in the WPML plugin. Link to a page where the issue can be seen: hidden link (site-wide problem)

/Yoast Support/
Thanks for getting in touch with the Yoast support team.

We would like to let you know that the hreflang tag is actually generated by a multilingual plugin and not by the Yoast SEO plugin. We recommend reviewing this guide to ensure you are not missing anything: hreflang: The ultimate guide.

Since you are using WPML plugin, please get in touch with them to help fix the hreflang language issues. You can also ensure that the lang is appropriate with these codes: hidden link

There should be a way to update the language in WPML plugin.

Symptoms:
The hreflang tags have incorrect language and region codes, affecting SEO.

Questions:
How can I fix the hreflang language issues using the WPML plugin?
Is there a way to update the language codes in the WPML plugin?

November 14, 2024 at 10:43 am #16401745

erkkiM

And i can see that error in site-wide

Screenshot 2024-11-14 at 12.42.54.png
November 14, 2024 at 3:00 pm #16403551

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

Welcome to the WPML support forum.

I would need a little more information about the issue.

- I visited your website and review the source code:

<link rel="alternate" hreflang="en" href="<em><u>hidden link</u></em>" />
<link rel="alternate" hreflang="et" href="<em><u>hidden link</u></em>" />
<link rel="alternate" hreflang="lv" href="<em><u>hidden link</u></em>" />
<link rel="alternate" hreflang="lt" href="<em><u>hidden link</u></em>" />
<link rel="alternate" hreflang="da" href="<em><u>hidden link</u></em>" />
<link rel="alternate" hreflang="nb-nb" href="<em><u>hidden link</u></em>" />
<link rel="alternate" hreflang="pl" href="<em><u>hidden link</u></em>" />
<link rel="alternate" hreflang="fi" href="<em><u>hidden link</u></em>" />
<link rel="alternate" hreflang="sv" href="<em><u>hidden link</u></em>" />
<link rel="alternate" hreflang="x-default" href="<em><u>hidden link</u></em>" />

- All languages are using the correct hreflang except for "nb-nb".
- This language is not a default WPML language, and I even see that the proper Norwegian language "no" is present in your debug info.

Did you create a second/custom Norwegian language?
I would recommend to use our default language which is correctly set up because you won't be able to use "no" for your custom language as it's already registered.

November 15, 2024 at 4:55 am #16405656

erkkiM

Yea, about nb i know. And thats not problem right now.

I made a video so you can see what i mean.
hidden link

/* Frog program*/
Description
URLs with hreflang annotations that contain invalid language (in ISO 639-1 format) and or optional regional (in ISO 3166-1 Alpha 2 format) values. Unsupported hreflang values can be viewed in the lower window 'URL Details' pane with an 'invalid' status.

How To Fix
Update hreflang annotations to include valid language and regional values, so they can be used for geotargeting the right audiences appropriately.

November 15, 2024 at 12:27 pm #16408297

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

Thanks for the video, it confirms that the issue encountered is the one I reported.

Let me explain:
- Your Norwegian language is using an incorrect language code "nb-nb"
- On all pages in all languages, you will have in the source code links to all translations (hreflang links).
- That's why the issue is reported even on Polish or English pages.
- That's because the Polish and English pages will contain a link to the problematic Norwegian language.

I took a screenshot of your video, when scanning the English homepage, in the bottom left part you can see that the "nb" language is invalid, while all other languages are valid.

Switching to our default Norwegian language "no" should fix this issue.

screenshot-2024_11_15-07_12_08.png