Disable WordPress Core Sitemaps

sitemap

WordPress started pushing own sitemaps after their Version 5.5 release. This is a wonderful feature which provides effortless sitemap generation. Works great for sites where all the pages and posts needs indexing. The default sitemap can then be submitted to the search engines and periodically sitemap gets updated as and when there is an update in site. It helps in the page indexing process and improves the website’s visibility.sitemap

However, if the wordpress site is a complex one where lots of custom post types are present and not all requires indexing. The default sitemaps can cause harm instead of any benefit. To resolve this, we can disable the wordpress core sitemaps.

Why Disable WordPress Core Sitemaps?

While the default sitemap generation is beneficial for many websites, there are scenarios where it might not be optimal. For instance:

Complex Websites with Custom Post Types

If your WordPress site has numerous custom post types and not all of them need to be indexed, the default sitemap can potentially include irrelevant content, which could confuse search engines.

Performance Concerns

For websites with a large number of pages, generating and maintaining a sitemap can consume valuable server resources, impacting performance.

To Prevent Duplicate Content Issues

If you’re using a third-party plugin that generates sitemaps and also has the capability to submit them to search engines, disabling the core sitemap can help avoid duplicate content issues. This is because having two separate sitemaps pointing to the same content can confuse search engines and potentially negatively impact your search engine rankings.

How To Disable WordPress Core Sitemaps

To disable the WordPress core sitemap generator, you can use the following code snippet:

add_filter( 'wp_sitemaps_enabled', '__return_false' );

This will turn off the wordpress’ default sitemaps.

Leave a comment

Your email address will not be published. Required fields are marked *