Sitemap PolyLang Multiple Domain

  • Hello

    I have just migrated a site to a new domain and busy setting up RankMath. THe website is multilingual but each language is on its own domain.

    So far, the problem is that the sitemap is not being generated for the alternative domains.

    So for example: does not reference my alternative language domain

    There is no sitemap on (but its the same website)

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello Brad,

    Thank you for getting in touch.

    You don’t need a separate Sitemap for a translated language. Your multi language plugin adds an hreflang tag to your posts which help Google determine that a piece of content is a translation of another post/page.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Hi Todd

    Thanks for your response. Regardless of the hreflang tag, which I understand how that works, I have seperate sites for seperate countries which may or may not have different content per site. Not everything needs to be the same on every site.

    So the point is, RM does not pick up nor generate ANY content from the other Multi Domains from PolyLang.

    In a standard polylang setup where langs are in subdirectories, this is not a problem.

    I have not even started talking about the other multilingual issues.

    Furthermore, you should know that google treats each website as its own. So it would make logical sense to publish a site map per site.

    Hi Brad,

    Thanks for the follow up.

    You can extend the Rank Math functionality by making use of the following filter to add URLs from the other languages to the sitemap:

     * Filter to add extra URLs to the XML sitemap by type.
     * Only runs for the first page, not on all.
     * @param string $content String content to add, defaults to empty.
    add_action( 'rank_math/sitemap/{$type}_content', function() {
    function rank_math_add_custom_dynamic_url( $urls ) {
        $urls .= '
        $urls .= '
        return $urls;

    I hope this info helps. Thank you.


    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.

Viewing 3 replies - 1 through 3 (of 3 total)

The ticket ‘Sitemap PolyLang Multiple Domain’ is closed to new replies.