Having a Pro Plugin Giveaway at Plugin Planet!
Web Dev + WordPress + Security

About the Auto-Generated WP Sitemaps and How to Disable Using Simple Code or a Free Plugin

WordPress Plugin: Disable WP Sitemaps WordPress 5.5 and beyond features built-in sitemaps that are enabled by default. For new users and sites this may be a good thing. Now users don’t have to bother with thinking about how to implement a sitemap. Like with Privacy control, WordPress just does it for you automagically.

BUT for the millions of sites that already have a sitemap thanks to any of the excellent and free sitemap plugins — that’s like maybe 5–10 million websites — well congratulations you now have a duplicate set of sitemaps.

You can check your WP Sitemap located at /wp-sitemap.xml

Hopefully your existing sitemap and the new WP sitemap are the same semantically. Otherwise who knows what big search engines will think, if there is any confusion, which one is canonical, and so forth. If you have done any sort of configuration or customization to your existing sitemap, chances are the new auto-generated WP Sitemap will not be identical. For all the people on this ride, you’ve got some choices..

New WP Sitemap rocking at Dev-Tricks.comScreenshot of the WordPress 5.5 sitemap located at /wp-sitemap.xml

Enabled by default

IF the new sitemaps are as I’ve read enabled by default, there are going to be millions of sites out there sporting two different sitemaps. The one they had configured via plugin, and now the new built-in automatically generated sitemap provided by WordPress 5.5 and beyond.

WordPress Plugin: Disable WP SitemapsWordPress 5.5 letting you know sitemaps have arrived.

What does that mean? It means that if you care about your visitors — both human and bot — you don’t want to confuse them by providing conflicting sitemap information. Who knows what that might do to your search engine rankings. Honestly I don’t know, but have done this long enough to know that I don’t really want to find out.

Note: WordPress will not generate any sitemap if your site has the setting “Search Engine Visibility” is enabled, so as to “discourage search engines from indexing this site.” In that case, the WP Sitemap is disabled.

Even if you don’t care at all about SEO, you don’t want duplicate sitemaps. Especially if they are different, even by a little bit, which is likely if you are using a plugin that has been configured with specific settings, based on your content and preferences.

The Solution = Decisions

So at this point, you either have an existing sitemap or not. If you do not already have a sitemap, congrats you have three options:

  • Go with the sitemap that WordPress creates automatically
  • Disable the WP sitemap and choose from many great and free sitemap plugins
  • Be a rebel and don’t add any sitemap (still requires that you disable the WP Sitemap)

OR, on the other hand, if you’re already rocking your own sitemap, you have a slightly different set of options:

  • Disable your existing sitemap/plugin and replace with the WP Sitemap
  • Disable the WP sitemap and choose from many great and free sitemap plugins
  • Rebel don’t want any sitemap (still requires that you disable the WP Sitemap)

For several of these choices, you’re gonna need to disable something. Either the WP Sitemap or your sitemap plugin. Fortunately WordPress is good about making it possible to disable new features. And the new WP Sitemaps thing is no exception. In fact it can be disabled with a single line of code:

add_filter('wp_sitemaps_enabled', '__return_false');

That’s all that’s needed to disable most of the WordPress sitemap functionality. One line of code does the trick for most of it. And that’s exactly what my new plugin does: it adds that line of code to your WordPress site to disable the sitemaps from displaying anywhere. So effectively sitemaps are disabled with the above code.

Got Robots? The robots.txt file is important for good SEO. To learn more, check out my post on better robots.txt rules for WordPress-powered sites.

Update: The WP Sitemaps feature also adds a line to the site’s virtual dynamically generated robots.txt file. It tells search engines and bots the location of the WP-generated sitemap. It looks like this:

Sitemap: https://dev-tricks.com/wp-sitemap.xml

Again that line is added only to the WP-generated robots.txt. WordPress does not add this line if you disable WP Sitemaps using any of the techniques described above.

Important: The above line of core WP code works to disable all of the front-end sitemap pages and so forth. It does not disable any of the changes that WordPress 5.5+ makes to your site’s permalink rules inside the .htaccess file. For more about this, visit the announcement post at WordPress.org.

Activate this plugin to disable the auto-generated WP Sitemaps.

Plugin Features

I try to keep all of my WordPress plugins as lightweight and fast as possible. The Disable WP Sitemaps plugin consists of one line of code, so it is lightweight and super fast. Other features include:

  • Clean, secure code
  • Simple to use – activate and done
  • No settings to worry about, strictly plug-&-play
  • Written according to the WP API and best practices
  • Cleans up after itself when uninstalled
  • Simple, lightweight, and flexible
  • Localized and translation ready
  • Easy peasy.

For more details about how it works, visit the plugin docs at WordPress.org.

Installation & Usage

First install and activate the plugin:

  1. Upload the plugin to your blog and activate
  2. Done!

There are no more steps :) This plugin works silently behind the scenes, with no need for any settings page. So it is super simple and completely effective at disabling WP Sitemaps.

Why is this useful?

I’m sure there are some super geniuses out there scratching their chins asking “why is this necessary?” Etc. I get ’em for most of my “disable-feature” type plugins. The first thing to understand is that it’s WordPress core itself that decided that this was necessary, as they provided a hook that enables easy disabling of WP sitemaps. So there you go.

But also, as explained in the above article. Disabling sitemaps is useful because there are many plugins that already implement sitemaps, and those plugins are used by a LOT of people. Like millions. So all those sites with existing sitemaps will have TWO sets of sitemaps when upgraded to WP 5.5.

As you can imagine, serving duplicate sitemaps is discouraged as it may confuse the search engines. You don’t want to confuse the search engines, do you. So with WP 5.5 and beyond, you can either remove your existing sitemap solution or install this plugin to disable the WP-generated sitemap. Or maybe you have a site that does not need a sitemap. Or maybe you just don’t want a sitemap, that’s your business pal.

Whatever the reason, this plugin will do the job with a click.

Download

Disable WP Sitemaps is open source and 100% free for everyone. Learn more and download at the WP Plugin Directory.

About the Author
Jeff Starr = Web Developer. Security Specialist. WordPress Buff.
WP Themes In Depth: Build and sell awesome WordPress themes.

7 responses to “About the Auto-Generated WP Sitemaps and How to Disable Using Simple Code or a Free Plugin”

  1. We have a family archive that doesn’t use SEO, sitemaps, and many other features that typical blogs use. Thank you for this plugin Jeff.

    • Thank you, Marcus. Also thank you for the great plugin reviews at WordPress.org. Very much appreciated.

  2. Hello Jeff, thank you very much for the great article. Innovations make things complicated, I’ve read that lazy loading is also built into WP 5.5 …. maybe you have a Code for deactivation. Greetings Olena

  3. Thank you. Appreciate the easy, quick, light fix.

  4. Thanks for sharing your knowledge dear Jeff, I was searching how to disable Auto-Generated WP Sitemaps using simple code, I try not to use plugins, even if they are Free and once more, I came across with one of your excellent & fully explanatory articles! Your solution helped me to develop my website, without having duplicate sitemaps.

Comments are closed for this post. Something to add? Let me know.
Welcome
Perishable Press is operated by Jeff Starr, a professional web developer and book author with two decades of experience. Here you will find posts about web development, WordPress, security, and more »
Wizard’s SQL for WordPress: Over 300+ recipes! Check the Demo »
Thoughts
Went out walking today and soaked up some sunshine. It felt good.
I have an original box/packaging for 2010 iMac if anyone wants it free let me know.
Always ask AI to cite its sources.
All free plugins updated and ready for WP 6.6 dropping next week. Pro plugin updates in the works also complete :)
99% of video thumbnail/previews are pure cringe. Goofy faces = Clickbait.
RIP ICQ
Crazy that we’re almost halfway thru 2024.
Newsletter
Get news, updates, deals & tips via email.
Email kept private. Easy unsubscribe anytime.