This thread is resolved. Here is a description of the problem and solution.
Problem:
You are trying to implement hreflang tags on your site, but they are not appearing as expected.
Solution:
The absence of hreflang tags is not an issue but an improvement introduced in WPML SEO 2.2.2, where hreflangs are moved to sitemaps for better performance with Yoast and RankMath. To include hreflang tags in pages, go to WPML -> Languages -> SEO Options and enable the setting there.
In this case, you should also add the following in your wp-config.php file, to disable it in the sitemaps:
define( 'WPML_SEO_ENABLE_SITEMAP_HREFLANG', false );
If you don't add the constant, the hreflangs will be duplicated. You will have them both in the sitemap and in each individual page. Although it shouldn't be a problem but it's redundant.
For more details on creating multilingual sitemaps, please visit Using WordPress SEO with WPML.
If this solution does not apply to your case, or if it seems outdated, we recommend opening 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. For further assistance, please visit our 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 5 replies, has 0 voices.
Last updated by 3 days, 20 hours ago.
Assisted by: Waqas Bin Hasan.