How to Disable Sitemaps in WordPress 5.5
Tags: wordpress
Published: 2020-08-13 02:33:11

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 <a href="https://metabox.io/build-gutenberg-blocks-visually-with-meta-box-builder/" rel="follow">Gutenberg blocks</a>, <a href="https://gretathemes.com/add-lazy-load-to-image-video/">lazy-loading images</a>, 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, <a href="https://gretathemes.com/series/Yoast-SEO/">Yoast SEO</a>, Rank Math, ... <strong>already have sitemaps</strong> <strong>to their websites</strong>. Therefore, the new sitemaps feature may cause <strong>duplication or conflict</strong> with sitemaps from these plugins.

<!--more-->

<img class="aligncenter" src="https://imgur.com/3fPtirB.png" alt="Sitemaps is one of new advanced features in WordPress." width="1344" height="567" />

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

But first, just have quick learning about XML sitemaps.

<h2>What is Sitemaps?</h2>

A sitemap is a file that contains all your website's URLs. For example, this is the XML sitemap of my website <a href="https://deluxeblogtips.com/" rel="follow">deluxeblogtips</a>.

<img class="aligncenter" src="https://i.imgur.com/C4867kH.png" alt="A sitemap is a file that contains all your website's URLs." width="1347" height="619" />

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 <a href="https://gretathemes.com/howto-submit-website-google/">website URLs are submitted correctly to search engines</a>.

<h2>Sitemaps in WordPress 5.5</h2>

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 <code>robots.txt</code> file exposed by WordPress.

You can configure sitemaps behavior by following <a href="https://make.wordpress.org/core/2020/07/22/new-xml-sitemaps-functionality-in-wordpress-5-5/">this instruction</a> from the WordPress developer team.

<h2>Why Should You Disable Sitemaps Created by WordPress 5.5</h2>

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:

<img class="aligncenter" src="https://imgur.com/7WPkV2V.png" alt="XML sitemaps created by WordPress 5.5" width="815" height="622" />

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.

<h2>Disable Core Sitemaps with Slim SEO</h2>

Using a plugin to disable sitemap is much easier, especially for non-coders. I recommend <a href="https://wpslimseo.com/" rel="follow">Slim SEO</a>, a free SEO plugin to do it because it's easy-to-use and really effective. It's available on <a href="https://wordpress.org/plugins/slim-seo/">wordpress.org</a>, so you just need to <a href="https://gretathemes.com/install-wordpress-plugin/">install and activate it normally</a>.

<img class="aligncenter" src="https://i.imgur.com/oafwaAV.png" />

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 <a href="https://gretathemes.com/optimize-website-slim-seo/">this article</a> about how to optimize your WordPress SEO with Slim SEO.

<h2>Disable XML Sitemaps Using Code</h2>

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 <code>functions.php</code> file:

<pre>add_filter( 'wp_sitemaps_enabled', '__return_false' );</pre>

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 <code>functions.php</code> file of your theme:

<pre>add_action( 'init', function() {

remove_action( 'init', 'wp_sitemaps_get_server' );

}, 5 );</pre>

<h2>Final Words</h2>

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 <a href="https://gretathemes.com/downgrade-wordpress-any-version/">downgrade WordPress to previous versions</a> anytime.  If you have any experience with this version or any question about it, feel free to share it with us.