Link the sitemap of a subdomain

#53454
  • Resolved Associazione Ph
    Rank Math free

    Hi there!

    How to link a sitemap of a subdomain site in the main site.

    Main site using Rank Math.

    Is there an option?

    Thank you!

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

    Thank you for contacting Rank Math today.

    I can suggest that you write some code to get the links from the subdomain and add them to the sitemap using the following filter:

    /**
     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() {
     return '         https://rankmath.com/some-custom-url/
             2020-02-20T20:20:20+00:00     
    ';
     }); 

    Looking forward to helping you. Thank you.

    ​​​​​​

    Thank you!
    where should I add that code?

    thanks!

    Hello,

    Thank you for contacting Rank Math today.

    The code should go to your theme’s functions.php file.

    Looking forward to helping you. Thank you.

    ​​​​​​

    Thank you!

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

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

The ticket ‘Link the sitemap of a subdomain’ is closed to new replies.