Background of the issue:
To improve SEO and avoid duplicate hreflang data, WPML now adds hreflang tags only to the sitemap. I have disabled the hreflang tags in the page's <head> section. I am trying to see if the hreflang tags are appearing in the sitemap as expected.
Symptoms:
The Rankmath Sitemap is not showing hreflang tags, and the option to enable them in the <head> is not enabled.
Questions:
Are hreflang tags supposed to appear in the sitemap when using Rankmath, or is this feature only compatible with Yoast?
Why are the hreflang tags not visible in the sitemap despite the settings? What I was wondering I have german formal on my website so i needed to have a different unofficial code. Might that be the problem?
To see the hreflang attributes, you need to view the page's source. (Right click -> View Page Source.) If you are looking for the hreflang attributes on the sitemap index here: hidden link, you will not find them, because the index page should not include them. However, if you check a specific sitemap, like the posts sitemap, you will find them: hidden link. Check it here: view-source:hidden link. Please see the attached screenshot.
Please let me know if you have any further questions.