Resources     Blog  

  1. Home
  2. WordPress Tutorials
  3. How to Resolve Yoast’s SEO Sitemap 404 Error in WordPress

How to Resolve Yoast’s SEO Sitemap 404 Error in WordPress

Are you trying to resolve Yoast’s SEO sitemap 404 error in WordPress? Yoast SEO is the best and most popular SEO plugin with over 1 million downloads. It can dramatically improve your website’s SEO, which is why I strongly recommend installing and setting it up. One of the first things Yoast SEO will do is try to create a sitemap for your website.

Unfortunately, there are a few things that can interfere with it and cause a 404 error page to appear. This is quite annoying for beginners that are using the plugin for the first time, but it can be easily fixed. Today, I will demonstrate how to resolve Yoast’s SEO sitemap 404 error in WordPress.

Why Use a Sitemap and What Causes the Problem

A sitemap’s primary goal is to help search engines locate your content, which is why an SEO plugin like Yoast creates one after activation. You might be thinking that search engines still find your content, but sitemaps use XML forms to give it a higher priority. A higher priority will result in your content ranking faster, but not higher. To rank higher you need to improve your website’s SEO practices, which this plugin will help you with.

Now you might be wondering what exactly can cause the problem. For starters, you only need one sitemap, so if you have another plugin that generates a sitemap, like Google XML Sitemaps, there will be an error. If you choose to use Yoast SEO, you should make sure to let it do everything. The other problem is if your theme is poorly coded. Every theme is unique and sometimes, they are a little too unique for their own good.

How to Resolve Yoast’s SEO Sitemap 404 Error in WordPress

Today, I will demonstrate how to resolve Yoast’s SEO sitemap 404 error in WordPress. Since you have run into this problem, the plugin must already be installed and activated. The first thing I will show you is how to deactivate and delete a plugin. You should delete any other plugins that create a sitemap. This will interfere with Yoast SEO. If this was not the problem, then your theme is to blame. There are three things you can do. The first is to edit your .htaccess file, which the plugin makes simple. The second is to change your theme’s core code, which I don’t recommend unless you are experienced. The last and probably simplest method is to change your theme.

How to Deactivate and Delete Plugins in WordPress

On the left-hand admin panel, click on Plugins and select the Installed Plugins option. This will display all of the plugins that are currently installed on your website.

Click on Plugins and select the Installed Plugins option.

Locate the plugin that is generating a sitemap for your website. This will usually include other SEO plugins, which you won’t need if you use Yoast, or specific plugins like Google XML Sitemaps that exist only to make sitemaps.

Click on the Deactivate option underneath the plugin name. If you do not see a deactivate option, but see an Activate and Delete option, that means the plugin is already deactivated.

Click on the Deactivate option underneath the plugin name.

Now click on the Delete option to delete the plugin.

Click on the Delete option to delete the plugin.

If the plugin you deleted was responsible for causing an issue, it should be resolved now. If you did not have a plugin that created a sitemap, then your theme is to blame.

Editing the .htaccess File

You can do this two ways. The first is through the Yoast SEO plugin and the second is through your control panel. I will demonstrate how to do it through the plugin, but the code is the same for both methods.

Since you are directly editing a file on your website, it is a good idea to create a backup of your website. This will ensure that if something goes wrong, you can revert to before it happened.

Click on the Tools option.

Click on the Tools option.

Click on the File Editor link.

Click on the File Editor link.

You should now see your .htaccess file. If you do not, then you may not have one. They are easy to create if that is the case. Simply copy and paste the following code into the file:

# WordPress SEO – XML Sitemap Rewrite Fix
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
</IfModule>
# END WordPress SEO – XML Sitemap Rewrite Fix

Click on the “Save Changes to .htaccess” button.

Click on the "Save Changes to .htaccess" button.

This should resolve the issue, but if it doesn’t then you will either have to rewrite the theme’s core code or install a new theme. You may need to turn the Yoast SEO sitemap option off then on again to see the error was fixed.

Congratulations, you have successfully fixed the Yoast SEO sitemap error. If the above methods did not work, I would recommend a new theme at this point because you are bound to run into other issues if the theme is clashing with Yoast SEO.

Rank Higher With Yoast SEO

Your website’s search engine ranking will greatly determine how much traffic your site will generate. Think about the last time you searched on Google and selected a link on a different page. You probably can’t because it is not very common. Ranking higher is imperative to the success of your website and using the Yoast SEO plugin can help you achieve it much easier and faster than normal.

Was a plugin responsible for interfering with Yoast SEO? Have you considered switching your theme?

Author: Chris Racicot

Chris is the Support Manager at GreenGeeks and has been with the company since 2010. He has a passion for gaming, scripting and WordPress. When he’s not enjoying his sleep, he’s working on his guitar skills and fiddling with 3d printing.

Was this article helpful?

Related Articles

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.