[Resolved] Video sitemap have wrong hreflang after last update
This thread is resolved. Here is a description of the problem and solution.
Problem: After a recent update, the video sitemap on your website incorrectly uses hreflang='cn' for Chinese instead of the correct hreflang='zn'. This error is causing issues with the Chinese version of your site. Solution: We have addressed this issue in the latest version of WPML SEO. First, ensure you back up your entire site. Then, update your WPML SEO to the latest version, which is WPML SEO 2.2.3. You can download the update from here. After updating, please verify that the hreflang attribute is corrected in your video sitemap.
If this solution does not apply to your case, or if it seems outdated, we recommend opening a new support ticket. Additionally, 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. For further assistance, please visit our support forum at 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.
Background of the issue:
I’ve noticed that after the latest update, my website's video sitemap got hreflang links. The Chinese hreflang is wrong; it uses hreflang='cn' instead of hreflang='zn' according to the hreflang standard. Full line:
Symptoms:
The Chinese hreflang is incorrect, causing issues with the Chinese version of my site.
Questions:
Why is the Chinese hreflang incorrect after the update?
How can I fix the hreflang issue in the video sitemap?
I followed your instructions exactly. When adding Chinese language I stated hreflang = "zn" and Code = "zh-hans" intentionally making them different as at my website.
And after adding video post at Chinese I can see that there is the same error. At video sitemap hreflang is taken not form language hreflang but from Code.
Please find screenshots attached.
Thanks for replicating the issue. It seems the Video Sitemap is using the language code instead of the hreflang value across all languages. I tried updating the hreflang for English and French, but the sitemap still uses the code.
I also tried some troubleshooting steps, but no luck so far. I’m escalating this to our 2nd tier support team and will keep you posted with any updates.