How To Quickly Disable The Default WordPress Sitemap

Do you want to disable the WordPress sitemap by default on your website?

The default sitemap function was introduced in WordPress 5.5, and it allows WordPress to automatically publish XML sitemaps for your website. The issue is that this function lacks advanced WordPress SEO features that are required to rank better.

We’ll teach you how to effortlessly disable the WordPress sitemap and replace it with a more robust alternative in this article.

Why Should You Turn Off WordPress Sitemap?

An XML sitemap is a file that specifies all of your website’s content in XML format, allowing search engines to easily identify and index your material. Sitemaps are extremely valuable to your website since they increase traffic and boost your SEO results.

However, many WordPress SEO plugins, such as All in One SEO, Yoast SEO, and Google XML Sitemaps, already include sitemaps, resulting in WordPress sites with two sets of sitemaps. Duplicate sitemaps for the same WordPress page might cause search engines to become confused and lower your SEO results.

You’re missing out on advanced features if you don’t use an SEO plugin for your sitemap. Many popular WordPress SEO plugins, for example, include features such as Video Sitemap, News Sitemap, RSS Sitemap, and others that you’ll need to outrank your competitors in SEO.

Using the WordPress SEO Plugin, disable the WordPress Sitemap. If you use one of the top WordPress SEO plugins, the default WordPress sitemap feature will be disabled and replaced with a more effective alternative.

All in One SEO is the finest WordPress SEO plugin for optimizing your website for search engines and social media networks. AIOSEO is used by over 3 million websites, including ours. All-in-One SEO will enable their Sitemap function by default, which will replace the normal WordPress sitemaps upon activation.

The first step is to install and activate the AIOSEO plugin. Please visit our article on how to install a WordPress plugin for more information. Once launched, the AIOSEO plugin must be configured. Then, from the WordPress admin dashboard, navigate to the All in One SEO » Sitemaps page to examine your sitemap settings.

Navigate to the ‘General Sitemap’ tab next. Make sure the ‘Enable Sitemap’ setting is set to ‘Active’ here. This will deactivate the WordPress sitemap by default.

AIOSEO General WordPress Sitemap

In addition to the General Sitemap, we recommend that you enable the video sitemap, news sitemap, and RSS sitemap on your website to improve your SEO rankings.

Using Code Snippet, disable WordPress Sitemap.

You may also use code to simply deactivate the default WordPress sitemap. You may place the code snippet in the functions.php file of your theme. The main issue with adding code to your functions.php file is that even a minor error might cause your website to crash.

That is why we propose adding custom code to WordPress using WPCode. This free plugin allows you to easily add code snippets to WordPress without having to alter the functions.php file of your theme. First, download and install the free WPCode plugin. Check out our article on How to install a free WordPress plugin for more details.

Then, in your WordPress dashboard’s left-hand menu, navigate to the new Code Snippets entry. This will take you to the page titled ‘All Snippets.’

Then, simply click the ‘Add New’ option.

WPcode Plugin - Add new option

Go to Code Snippets and click Add New WPCode. This will take you to the ‘Add Snippet’ page, where you can add your own custom code or search for an existing snippet in the WPCode library.

Simply mouse over the ‘Add Your Custom Code (New Snippet)’ option and click ‘Use snippet’ since we need to add custom code.

WPcode Plugin - use snippet

You will now be sent to the ‘Create Custom Snippet’ page. You may begin by giving your code snippet a name. It may be whatever you choose.

Then, on the right, pick a ‘Code Type’ from the dropdown menu. Because we’ll be utilizing PHP code, simply select the ‘PHP Snippet’ option.

PHP snippet

Then, under the ‘Code Preview,’ just copy and paste the following PHP code snippet.

1
 add_filter( 'wp_sitemaps_enabled', '__return_false' );

This is what it will look like once you’re done.

code

Scroll down to the ‘Insertion’ section after pasting the code to discover two insert methods.

Simply choose the ‘Auto Insert’ option if you want it to run throughout the entire site.

insert method

Now, at the top of the page, change the switch from ‘Inactive’ to ‘Active,’ and then click the ‘Save Snippet’ button.

When you save and activate the code snippet, it becomes active and disables the default WordPress sitemap.

custom code snippet

Conclusion

We hope this post was useful in teaching you how to disable the default WordPress sitemap.

A WP Life
A WP Life

Hi! We are A WP Life, we develop best WordPress themes and plugins for blog and websites.