how to create multiple post sitemap

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

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for the delay and for any inconvenience this issue may have caused you.

    You can use and modify this filter to add a custom 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() {
     return '         https://rankmath.com/some-custom-url/
             2020-02-20T20:20:20+00:00     
    ';
     }); 

    Please note that you need to replace {$type} with either post or page or any other custom post type that you want to register and then add the URLs using some custom logic to an array and return it.

    I hope that helps. Thank you, and please don’t hesitate to contact us anytime if you need further assistance.

    Hello sir i want to create sitemap like this

    Yourdomain.com/post-sitemap1.xml

    Yourdomain.com/post-sitemap2.xml

    https://prnt.sc/10rctd5

    Sitemap image

    Hello,

    Thank you for that information.

    Rank Math automatically creates an additional sitemap like you have shared when your posts count exceeds the Links Per Sitemap you have set in Rank Math > Sitemap Settings > General

    Links per sitemap

    For example, you have 500 posts and set the links per sitemap to 200, your sitemaps will be:

    Yourdomain.com/post-sitemap1.xml – 1-200
    Yourdomain.com/post-sitemap2.xml – 201-400
    Yourdomain.com/post-sitemap3.xml – 401-500

    I hope that helps. Thank you, and please don’t hesitate to contact us anytime if you need further assistance.

    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 3 replies - 1 through 3 (of 3 total)

The ticket ‘how to create multiple post sitemap’ is closed to new replies.