Support » Plugin: Rank Math SEO - Best SEO Plugin for WordPress » Function to get sitemap url

  • Resolved Zoker


    Hi there,

    I’m trying to integrate your plugin with WP Rocket, but I’m not sure, what the correct method is to get the sitemap url.

    Yoast: WPSEO_Sitemaps_Router::get_base_url( 'sitemap_index.xml' );
    Seo Framework: the_seo_framework()->get_sitemap_xml_url();

    I tried
    RankMath\Modules\Sitemap\Router::get_base_url( 'sitemap_index.xml' ); but does not seem to work.

    So whats the correct function call?


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

    Thank you for contacting the support.

    Can you please tell us if you are trying to enable the cache for the sitemap?

    If so, you do not need to, Sitemap has its inbuilt caching system.

    Please let us know your thoughts. Looking forward to helping you.

    Thread Starter Zoker


    Hello @mythemeshop

    No the integration will tell WP Rocket all the pages it needs to cache. So WP Rocket can read the sitemap and go through all the pages/posts and cache them.
    That’s why is need the URL

    You can see other integrations here:

    Hello @zoker

    Sorry for the confusion. Are you talking about a setting like this?

    If so, we have emailed WP Rocket for the same and it shall be added soon to the plugin.

    We seek your patience and understanding in this matter. Thank you.

    Thread Starter Zoker


    Yes exactly šŸ™‚

    BTW you can easily open a PR in their repo instead of mailing them šŸ˜‰

    But nice that you added it that fast!

    Hello @zoker,

    Thank you. We have submitted the code to them and they were quick to reply.

    In one of the upcoming updates of WP Rocket, you would notice the compatibility.

    Hope that helps. If you have any further question(s), please let us know.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Function to get sitemap url’ is closed to new replies.