DEV Community

Cover image for How to Disable Sitemaps in WordPress 5.5
GretaThemes
GretaThemes

Posted on • Updated on • Originally published at gretathemes.com

How to Disable Sitemaps in WordPress 5.5

The latest version of WordPress has been released on August 11th. It's hot news among the WordPress community as this version includes a lot of features for Gutenberg blocks, lazy-loading images, auto-update for themes and plugins, ... Sitemaps is one of these advanced features to help you have a better SEO score. However, users who installed SEO plugins like Slim SEO, Yoast SEO, Rank Math, ... already have sitemaps to their websites. Therefore, the new sitemaps feature may cause duplication or conflict with sitemaps from these plugins.

Sitemaps is one of new advanced features in WordPress.

To avoid the potential problem caused by sitemap conflict and duplication, we will show you how to disable the sitemaps feature in WordPress 5.5. You can use two methods to disable this feature: using a plugin or adding code.

But first, just have quick learning about XML sitemaps.

What is Sitemaps?

A sitemap is a file that contains all your website's URLs. For example, this is the XML sitemap of my website deluxeblogtips.

A sitemap is a file that contains all your website's URLs.

Normally, search engines use a bot to automatically crawl website data, and then index and store it on their database. Whenever users search for some keywords, search engines will find the most relevant and suitable data for these keywords to display on SERPs. However, this process takes a long time, so you need to have a sitemap to fasten it and have more chances to display your website on SERPs. Thanks to sitemap, search engines can "read" your site quickly and easily. It also ensures that all your website URLs are submitted correctly to search engines.

Sitemaps in WordPress 5.5

By default, WordPress 5.5 includes an extensible core sitemap to help search engines find your most important pages. This sitemap can be created for all queryable post types, taxonomies, author archives, and homepage.

WordPress will expose a sitemap index, which can hold up to 50000 sitemaps while a single one can hold (filterable) at least 2000 entries, at /wp-sitemap.xml. Search engines can easily read this sitemap thanks to the robots.txt file exposed by WordPress.

You can configure sitemaps behavior by following this instruction from the WordPress developer team.

Why Should You Disable Sitemaps Created by WordPress 5.5

There are some reasons that you should disable sitemaps created by WordPress 5.5. One of them is that these sitemaps just look quite boring, like some plain texts. Here is an example of WordPress sitemaps:

XML sitemaps created by WordPress 5.5

Although the main sitemaps' "readers" are Google's bot, in many cases, users may visit the sitemaps to verify some information. Therefore, a good-looking sitemap will bring a better user experience.

Besides, there is no information about the last modified date of posts in this sitemaps. This is not the most important factor of sitemaps, but it will provide useful information for Google about when posts are updated.

Disable Core Sitemaps with Slim SEO

Using a plugin to disable sitemap is much easier, especially for non-coders. I recommend Slim SEO, a free SEO plugin to do it because it's easy-to-use and really effective. It's available on wordpress.org, so you just need to install and activate it normally.

Slim SEO will automate all the SEO work, including XML sitemaps, without any configuration. Therefore, after you install this plugin, it already enables sitemaps and disables WordPress default sitemap.

If you want to discover and make use of Slim SEO, refer to this article about how to optimize your WordPress SEO with Slim SEO.

Disable XML Sitemaps Using Code

In case you don't like using a plugin, you have two options to work with code: quickly disable or totally remove WordPress 5.5 default XML sitemaps.

To quickly disable WordPress 5.5 default XML sitemap, insert the following code to the theme's functions.php file:

add_filter( 'wp_sitemaps_enabled', '__return_false' );

But that way just hides the XML sitemap and still keeps all the functions. To permanently remove WordPress XML sitemaps functionality completely, insert this code in the functions.php file of your theme:

add_action( 'init', function() {

remove_action( 'init', 'wp_sitemaps_get_server' );

}, 5 );

Final Words

Now you know the quick and easy ways to disable XML sitemaps in WordPress 5.5. Depending on your website and your demand, you may decide to keep or remove this feature. For example, if you haven't added sitemaps yet, you should keep the WordPress default sitemaps.

This version has many other features and I think users will need time to explore and test all of them.  In case you're confused with new features on this version of WordPress, so don't worry because you can downgrade WordPress to previous versions anytime.  If you have any experience with this version or any question about it, feel free to share it with us.

Top comments (0)