Heart+Soul Design Studio

Custom Wordpress development, maintenance and security. Home of the AHA! Academy.

  • start hereHome
  • get the deetsAbout US
    • Disclosures
    • Privacy
    • Service TOS (Terms of Service)
  • email us hereProject Inquiry
    • Client ♥
  • read onThe Blog
  • get the goodsShop
    • Migrations
    • Plugins
    • Services
    • Site Security
    • Cart
    • My Account
    • Checkout
    • Shop TOS & Refund Policy
  • our recommendedResources

Join the Newsletter

Get Tips · Tricks & Goodies
right in your inbox!

Two Easy Ways To Fix Yoast’s WordPress SEO Sitemap 404 Error

Tweet
Share3
Pin3
Reddit
Flip
Pocket
6 Shares

404 error page

The Problem:  After setting up Yoast WordPress SEO sitemap, and clicking the link for it you get the dreaded Yoast Sitemap 404 error!

Fix Yoast Sitemap 404 error with these snippets.

While this issue has never been a problem for me in the past, for some users it has been a  real pain. Recently several of my  clients ran into the issue of getting a 404 error for their sitemaps generated by Yoast’s WordPress SEO plugin. After trying a few things, I was able to figure out the solution. In this article, I am going to show you how to fix the Yoast sitemap 404 error in right in the WordPress SEO plugin by Yoast. There’s a seperate fix if you’re using W3 Total Cache and have the same problem.

It is important that you understand that this issue is most likely caused by poorly coded theme function or another plugin. But it’s easy enough to fix. Yoast’s plugin works fine on my sites. I use custom coded themes and plugins.

First be certain you have no conflicting plugins (any plugin that might generate an xml sitemap). If you have one, disable and delete it.

Then you should  open your .htaccess file (you can actually do this from WordPress SEO plugin / Edit Files option) and simply add the following code in there:

[pastacode lang=”markup” message=”” highlight=”” provider=”manual” manual=”%23%20WordPress%20SEO%20-%20Sitemap%20Rewrite%20Fix%0A%3CIfModule%20mod_rewrite.c%3E%0ARewriteEngine%20On%0ARewriteBase%20%2F%0ARewriteRule%20%5Esitemap_index.xml%24%20%2Findex.php%3Fsitemap%3D1%20%5BL%5D%0ARewriteRule%20%5E(%5B%5E%2F%5D%2B%3F)-sitemap(%5B0-9%5D%2B)%3F.xml%24%20%2Findex.php%3Fsitemap%3D%241%26sitemap_n%3D%242%20%5BL%5D%0A%3C%2FIfModule%3E%0A%23%20END%20WordPress%20SEO%20-%20Sitemap%20Rewrite%20Fix”/]

Save and then go to WordPress Settings/Permalinks and re-save your permalink structure.  You should be able to see your sitemap index when you click  You can find your XML Sitemap here. When you submit your sitemap to google INSERT only the  portion of the url that is /sitemap_index.xml. (BE SURE YOU REMOVE THE PERIOD)

 

If  you have W3 Total Cache active, that is preventing 404 errors for static files to go through to WordPress. Update to the latest version of W3 Total Cache or add, under the browser cache page, this exemption:

[pastacode lang=”markup” message=”credit: Yoast” highlight=”” provider=”manual” manual=”sitemap(_index%7C%5B0-9%5D%2B)%3F.xml”/]

Save and then go to WordPress Settings/Permalinks and re-save your permalink structure.  You should be able to see your sitemap index when you click  You can find your XML Sitemap here. When you submit your sitemap to google INSERT only the  portion of the url that is /sitemap_index.xml. (BE SURE YOU REMOVE THE PERIOD)

Does working inside your WordPress installation ‘freak’ you out? Totally afraid you’ll blow your site out of the water? Fear Not!  We can help, just visit our Project Inquiry and we’ll get you taken care of in a blink of the eye.

Tweet
Share3
Pin3
Reddit
Flip
Pocket
6 Shares

Filed Under: Code Snippets

[wp_ad_camp_1]
Please note our rules.kitteh


By submitting a comment here you grant this site a perpetual license to reproduce your words and name/web site in attribution. We hold comments in moderation and we reserve the right to edit and/or delete your comment if it pertains only to keywords, is spammy or if it contains no viable reference to the article on which you are commenting. Thanks for understanding.


Older
Newer

Comments

  1. JO says

    November 13, 2014 at 11:52 am

    Hi,

    Very new at this! Have managed to generate the sitemap through Yoast and submitted to Google Webmaster. 3 of the 4 sitemaps were recognised almost immediately but one (posts- the most important one!)- is still pending with the dreaded 404 error message. I’ve updated to W3Cache Total, and resaved permalinks, I’ve also disabled sitemaps and re-saved…still error message and pending.

    I saw on the Yoast blog that this sometimes happens if you have no content in that category, but I have numerous posts, so I am in a puzzle…

    Any advice? Not at all familiar with code, so please be gentle and explain like you are talking to a 2 year old.

    Many thanks,
    Jo

    • Debbie says

      January 23, 2015 at 10:10 am

      disable your caching and resubmit the entire sitemap

  2. Mark S. says

    February 2, 2015 at 1:55 pm

    Thank you very very much Debbie!
    It worked well with Yoast and finally I could get my pages properly indexed (alongside with other Google recommended techniques).

    Best thoughts!

    • Debbie says

      February 10, 2015 at 10:17 am

      glad you got it sorted!

  • Facebook
  • Instagram
  • Pinterest
  • Twitter

sovrn Holdings, Inc.

Get A Leg Up On Your Competition

SEMrush

Hello You Designs - Designer Quality Wordpress Themes
The owner of this website, Heart+Soul Studio, is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking Heart+Soul Studio to Amazon properties including, but not limited to, amazon.com, endless.com, myhabit.com, smallparts.com, or amazonwireless.com.

Categories

  • Tips and Tricks
  • Bloggers
  • SEO & Content Development
  • Code Snippets
  • Security

The Shop

  • Shop
  • Cart
  • Checkout
  • My Account
  • Shop TOS & Refund Policy

Get Social

  • Twitter
  • Facebook
  • Pinterest
  • Instagram

The Links

  • Home
  • The Blog
  • Shop
  • Client Praise
  • Project Inquiry
  • Email
  • Facebook
  • Instagram
  • Pinterest
  • Twitter

Copyright © 2025 · Heart+Soul Design Studio · Made With ❥ In Louisiana

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.Accept Reject Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled

Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.

Non-necessary

Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.