Home›Support›English Support›[Waiting for user confirmation] Hreflang: Incorrect Language & Region Codes
[Waiting for user confirmation] Hreflang: Incorrect Language & Region Codes
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.
WordPress 6.7 has introduced a new issue that impact translations, please update WooCommerce and WPML to the latest versions before you report issues. More about this here - https://wpml.org/errata/php-error-wp-6-7-notice-function-_load_textdomain_just_in_time-was-called/
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?
- 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.
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.
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.