How to Disable the Built-in WordPress Sitemap


If you’ve been working on your site's SEO, you might have noticed that WordPress now includes a default XML sitemap. While this is a great feature, if you're already using an SEO plugin like Yoast SEO or Rank Math, you'll likely want to disable the default WordPress sitemap to avoid any conflicts.

Don't worry, it's a simple process! Follow these quick steps to get it done.

Step 1: Get the Right Tools

To disable the built-in sitemap, you'll need to add a small snippet of code to your website. The easiest way to do this without touching your core theme files is by using a code snippets plugin like "Code Snippets" or by adding it to your functions.php file (if you're using a child theme). Using a plugin is highly recommended, as it's safer and prevents potential issues with theme updates.

Step 2: Add the Code Snippet

Once you have your code snippets plugin installed and activated, you're ready to add the magic line of code.

  1. Navigate to your WordPress dashboard.
  2. Go to the "Snippets" or "Code Snippets" menu (the name may vary depending on the plugin).
  3. Click "Add New" to create a new snippet.
  4. Give your snippet a clear name, like "Disable WordPress Sitemap."

Now, copy and paste the following line of code into the code box:

add_filter( 'wp_sitemaps_enabled', '__return_false' );
  1. Save and activate the snippet.

That's it! The built-in WordPress sitemap is now disabled. You can confirm by trying to access your old sitemap URL (usually yoursite.com/wp-sitemap.xml). It should now show a 404 "Page Not Found" error.

A Quick Note:

If you are using an SEO plugin, be sure to check its settings to ensure your new sitemap is correctly configured and working.

If you have any questions, our support team is always here to help!


Was this answer helpful?

One email a month. Endless business benefits.

Don't miss out on WMTWWFY — the newsletter that keeps your website fast, safe, and visible.

« Back
Spinner
aluminium-anthropoid Security Check