Thanks for pointing this out 👍
You’re right — get_bloginfo('language') returns a locale format like en-GB, which does not comply with Google News sitemap requirements that expect an ISO 639 language code (e.g. en, fr, hi), except for zh-cn and zh-tw.
I’ll update the plugin to normalize the value by:
- Converting the locale to lowercase
- Extracting only the ISO 639 language part before the hyphen
- Applying Google News exceptions for Chinese (
zh-cn, zh-tw)
Example fix:
$lang = strtolower( get_bloginfo('language') ); $lang = explode('-', $lang)[0];
This should ensure the <news:language> tag is always valid according to Google’s News Sitemap guidelines.
Thanks again for the clarification and reference link.
Thank you for the decision.
I made a local fork of your plugin, as I needed integration with other plugins.
If I discover any other issues, I will certainly let you know.
Thanks for the update 👍
That makes sense — glad the plugin worked well enough for your integration needs.
If you notice anything that could be improved or think a change might be useful for the core plugin, feel free to share it here.
Appreciate you taking the time to report back.