Sitemap doesn’t include sub-domain

#721253
  • Resolved Williams
    Rank Math free

    Hi. I recently add a new subdomain for french language to my main domain “mainsim.com”.
    I’m managing the subdomain as a different wordpress website at “fr.mainsim.com”.
    I’m not using any translation plugin.
    Once I put online the new subdomain I also updated the sitemap of the main site, but the “fr.mainsim.com” link doesn’t showing in the “page-sitemap.xml”.
    Do you have any idea how can I resolve the issue?

Viewing 1 replies (of 1 total)
  • Hello, we apologize for the inconvenience you’re experiencing with your sitemap. It seems that the subdomain “fr.mainsim.com” is not showing in the “page-sitemap.xml”.

    To resolve this issue, you can add the following piece of code anywhere in your theme’s functions.php file:

    add_filter( 'rank_math/sitemap/entry', function( $url, $type ) {
        if ( 'page' === $type && false !== strpos( $url, 'fr.mainsim.com' ) ) {
            $url = str_replace( 'fr.mainsim.com', 'mainsim.com/fr', $url );
        }
        return $url;
    }, 10, 2 );

    This code will help ensure that the subdomain “fr.mainsim.com” is correctly included in the sitemap. If you encounter any issues while implementing this solution, please feel free to reach out to us for further assistance.

    Sources:
    Multilingual SEO with Rank Math SEO & WPML » Rank Math
    Troubleshooting the “Couldn’t Fetch” Error in Google Search Console » Rank Math
    Rank Math Sitemap Issues and Their Fixes » Rank Math
    How to Enable Sitemaps for Tag Archives » Rank Math

    This is an automated reply from Rank Math Support Bot. If you need further assistance, please reply to this topic and a human support agent will reply to you shortly.

    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.

Viewing 1 replies (of 1 total)

The ticket ‘Sitemap doesn’t include sub-domain’ is closed to new replies.