Hello,
I apologize for the issue you are facing with creating the hreflang XML sitemap for your multilingual site. To clarify, the hreflang tags are typically added automatically by plugins like Rank Math when you have your multilingual content set up correctly. Since you mentioned that you have already generated the XML sitemap and the hreflang tags, you shouldn’t need to manually insert them into your theme files.
Here’s a brief overview of how it works:
- Automatic Generation: When you use Rank Math with WPML or TranslatePress, the hreflang tags are automatically generated for your translated pages. You can verify this by checking your XML sitemap at `https://rankmath.com/wp-content/uploads/2022/11/add-shortcode-post-scaled.jpg.
- No Manual Insertion Needed: You do not need to manually insert the hreflang tags into your
header.php
file. The plugin handles this for you.
- Check Your Settings: Ensure that your Rank Math settings are configured correctly to support multilingual SEO. You can check this in the Rank Math dashboard under the Sitemap settings.
If you still have questions or if something isn’t working as expected, please reply to this ticket with more details, and a human agent from the Rank Math Support team will assist you further. Thank you for raising this concern!
Sources:
Multilingual SEO with Rank Math SEO & WPML » Rank Math
How to Perform SEO for Multiple Languages Using Rank Math and TranslatePress » Rank Math
Thanks for the prompt reply. I cannot check the sitemap details for the Hreflang tag automatically generated by the plugin WPML or TranslatePress; I don’t have this plugin installed. Kindly guide me on this. As replied by you, the correct setting Under RankMath sitemap, is unable to be found for the hreflang tag XML site map.
Hello,
Thank you for contacting Rank Math support.
Multilingual plugins add a special tag called hreflang
to your pages, which tells Google and other search engines what language and region your page is targeting. This way, Google can find and index your translated URLs from the hreflang
tag, and show them to the relevant users.
If you want to have more control over your multilingual sitemaps, you can also try WPML, TranslatePress, or Weglot as these plugins are fully compatible with Rank Math.
We hope this clarifies your question. Please let us know if you need any further assistance. We’re always here to help you.
Thank you very much. I will try above.
Hello,
Sure, let us know how this goes.
Meanwhile, please don’t hesitate to contact us anytime if you have other questions to assist you further.
Looking forward to helping you.
Thank you.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.