Hello,
Thank you for contacting Rank Math and bringing your concern to our attention.
Can you please confirm if you want to change the base URL of your sitemap? If so, you may try adding the following filter to change that:
https://rankmath.com/kb/filters-hooks-api-developer/#change-sitemap-base
/**
* Filter to change the Sitemap URL Base
*
* @param string $base New URL Base
*/
add_filter( 'rank_math/sitemap/base_url', function( $base ){
return '/blog/';
}, 10, 1 );
Once done, your sitemap should look like below:
https://yoursite.com/blog/sitemap_index.xml
To learn how you can filter/hook to your WordPress site, please follow the URL I’ve shared below:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
If there’s any issue you’re encountering with your sitemap after applying the filter above please try flushing the sitemap cache by following the steps below:
1. Flush the Sitemap cache by following this video screencast:
https://i.rankmath.com/pipRDp
2. Exclude the Sitemap files of the Rank Math plugin in your caching plugin. The cache could be via a plugin or from the server. For plugins or Cloudflare, please follow this article:
https://rankmath.com/kb/exclude-sitemaps-from-caching/
3. If the above steps doesn’t seem to work, kindly apply the following filter code to your site.
add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
Hope that helps, and please do not hesitate to let us know if you need our assistance with anything else.
Thank you.