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, a few things 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.
What Is A Sitemap?
A sitemap is a list of website pages on a specific domain. The purpose is to help search engines find all of the content on your website that you want them to find. Thus, it only includes pages that have indexing turned on.
While search engines can find your content without a sitemap, it is inefficient. Sitemaps utilize XML forms that give it a higher priority. As a result, your pages will rank faster with a sitemap than without one.
It also ensures that search engines do not miss any pages. For instance, you published two new posts on the same day. It’s possible for one of those to rank at different times. Instead, you can directly upload your sitemap to Google, or other search engines, to speed up the process.
As such it is one of the best SEO practices your website can implement.
What Causes a 404 Error with Yoast SEO?
So what exactly causes the 404 error in Yoast SEO?
One of the most common reasons this error occurs is if you have another plugin that creates a sitemap. They will end up interfering with one another and typically create a 404 error. If this is the problem, you simply need to get rid of the other plugin.
The other main culprit is your theme. The way each theme is coded can be drastically different, and sometimes, they are a little too different for some plugins to function. This is far more common in older themes, and the simplest solution to switch to a different theme.
I’ll go through both of these solutions below in more detail.
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.
Method 1: Deactivate and Delete Plugins in WordPress
This should be a very standard process for most WordPress Developers. Regardless of if there is an error or not, you should always deactivate and delete plugins you do not use. It is a waste of server space and can cause headaches later on.
Step 1: Deactivate Plugin
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.
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.
Step 2: Delete Plugin
Now 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.
Method 2: 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 recommended to create a backup of your website. This will ensure that if something goes wrong, you can revert to it before it happened.
Step 1: Locate .htaccess File
Click on the Tools option.
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.
Step 2: Add the Code
Simply copy and paste the following code into the file:[ht_message mstyle=”info” title=”” show_icon=”” id=”” class=”” style=”” ]# WordPress SEO – XML Sitemap Rewrite Fix
RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
# END WordPress SEO – XML Sitemap Rewrite Fix[/ht_message]
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 finding a new theme at this point because you are bound to run into other issues if the theme is clashing with Yoast SEO.
What Else Can Yoast SEO Do?
Yoast SEO does a lot more than just sitemaps.
The most useful features include its ability to monitor your SEO and Readability rating while you are creating or editing content. The SEO rating will look at keyword usage, inbound and outbound links, ensure a meta description exists, and much more.
Whereas, the Readability score looks at how visitors will view your content. It looks for consecutive sentences, past tense usage, and a Flesch reading score to name a few. By using Yoast Not only do you improve SEO, but also how your content reads.
There are a variety of premium add-ons that help websites in specific areas but be warned these are premium tools. That said, they are well worth the money. These include:
- Yoast Local SEO
- Yoast Video SEO
- WooCommerce SEO
- Yoast News SEO
Ensuring your website is visible on a search engine is a form of marketing. After all, it ensures that visitors/customers can find your website. Thanks to these features, and many more, Yoast SEO remains the most popular SEO plugin for WordPress.
Rank Higher With Yoast SEO
Your website’s search engine ranking will have a huge impact on how much traffic your site will generate. Think about the last time you searched on Google and selected a link on a different page. Odds are, you 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.