Background of the issue:
I am trying to have correct hreflang in my sitemap XML with good references to the correct fr / en / x-default URLs. The issue can be seen at hidden link. I have a RankMath Pro license and I’m using the WPML plugin with a paid license. I ran tests to identify the possible source of the error, including deleting transients, rebuilding RankMath database tables, completely removing RankMath, installing and activating Yoast SEO (and the sitemap were correct with this plugin), and checking for plugin conflicts. I also cleared the cache multiple times and ensured no custom code was added to the hreflang or sitemap XML generation.
Symptoms:
I’m experiencing an issue with XML sitemaps containing invalid hreflang tags. The hreflang URLs either redirect or point to 404 pages. When RankMath is installed, the hreflang tags in the sitemaps are incorrect, but they are correct with Yoast SEO. The problem persists even after deactivating all plugins except Rank Math and WPML.
Questions:
Do you have any idea what might be causing the issue?
We have activated the hreflang in the <head> of pages.
The correct hreflang links are displayed in the <head>
The incorrect ones are still displayed in the sitemap file, there has been no change.
I would like to look at this directly on your site. For this I would need temporary access (WP-Admin and FTP) to your site, preferably to a test/staging site where the problem has been replicated if possible.
The required fields can be found below the comments section. The information you enter is private, i.e. only you and I can see it and have access to it.
I may need to replicate your website locally. To do this, I need to temporarily install a plugin called "Duplicator" or "All in One WP Migration" on your website. This will allow me to create a copy of your website and content. Once the issue is resolved, I will delete the local website. Let me know if this works for you.
IMPORTANT
Please make a backup copy of the site files and database before giving us access.
- If you do not see the wp-admin/FTP fields, this means your post and site login details are being made PUBLIC. DO NOT post your website details if you do not see the required wp-admin/FTP fields. If you do not, ask me to enable the private box. The private box looks like this: