Title: Disable wp_sitemaps function?
Last modified: August 8, 2021

---

# Disable wp_sitemaps function?

 *  Resolved [Marlimant](https://wordpress.org/support/users/marlimant/)
 * (@marlimant)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/disable-wp_sitemaps-function/)
 * Hi:
    WordPress 5.5 includes its own wp_sitemaps function. Do I have to disable
   it including `add_filter( 'wp_sitemaps_enabled', '__return_false' );` in functions.
   php to this plugin works without duplicate the xml information?
 * Thanks.
    -  This topic was modified 4 years, 10 months ago by [Marlimant](https://wordpress.org/support/users/marlimant/).

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * (@ravanh)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/disable-wp_sitemaps-function/#post-14768278)
 * 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 🙂
 *  Plugin Author [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * (@ravanh)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/disable-wp_sitemaps-function/#post-14769532)
 * 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).
 *  Thread Starter [Marlimant](https://wordpress.org/support/users/marlimant/)
 * (@marlimant)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/disable-wp_sitemaps-function/#post-14769964)
 * Great idea!
    I will need to delete the redirection too after the next release
   of this plugin? Thank you.
 *  Thread Starter [Marlimant](https://wordpress.org/support/users/marlimant/)
 * (@marlimant)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/disable-wp_sitemaps-function/#post-14769970)
 * I’m using /sitemap-news.xml too. The redirection will work for news sitemaps 
   too?
 *  Plugin Author [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * (@ravanh)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/disable-wp_sitemaps-function/#post-14772294)
 * 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 🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Disable wp_sitemaps function?’ is closed to new replies.

 * ![](https://ps.w.org/xml-sitemap-feed/assets/icon-128x128.png?rev=1112143)
 * [XML Sitemap & Google News](https://wordpress.org/plugins/xml-sitemap-feed/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/xml-sitemap-feed/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/xml-sitemap-feed/)
 * [Active Topics](https://wordpress.org/support/plugin/xml-sitemap-feed/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/xml-sitemap-feed/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/xml-sitemap-feed/reviews/)

## Tags

 * [duplicate](https://wordpress.org/support/topic-tag/duplicate/)

 * 5 replies
 * 2 participants
 * Last reply from: [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/disable-wp_sitemaps-function/#post-14772294)
 * Status: resolved