Hi, yes you could do that while waiting for the next release of this plugin which will include the filter to disable the internal sitemap 🙂
Also, if you want to create a redirect for the core sitemap index to this plugin’s sitemap index, you can add this action:
add_action(
'template_redirect',
function() {
if ( ! empty( $_SERVER['REQUEST_URI'] ) && substr( $_SERVER['REQUEST_URI'], 0, 15) === '/wp-sitemap.xml' ) {
wp_redirect( home_url( 'sitemap.xml' ), 301 );
exit();
}
}
);
PS: And do not forget to visit your Permalinks admin page to flush the old rewrite rules (only a visit to that page is enough).
Great idea!
I will need to delete the redirection too after the next release of this plugin?
Thank you.
I’m using /sitemap-news.xml too. The redirection will work for news sitemaps too?
No, after the update you will not need to delete the code. You can but you do not have to because it will not break anything. Your news sitemap should be fine too 🙂