Hello,
Thank you for contacting Rank Math and bringing your concern to our attention.
Apologies for the delay as we currently have a high volume of tickets here in our support forums.
To change your sitemap URL, please apply this filter on your site:
/**
* Filter: 'rank_math/sitemap/index_slug' - Modify the sitemap index slug.
*
* @param string $slug Sitemap index slug.
*
* @return string
*/
add_filter( 'rank_math/sitemap/index/slug', function($slug) {
return 'newsitemap';
}, 10, 1 );
And here’s how you can add a filter:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
Once done, please follow the steps to flush the sitemap cache:
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. Add this filter as well to your site:
/**
* Filter if XML sitemap transient cache is enabled.
*
* @param boolean $unsigned Enable cache or not, defaults to true
*/
add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
Hope that helps.
Thank you.
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.