Yoast Sitemap – Page not Found – How to Fix

Wordpress Shortcodes

After setting up Yoast, you assign Yoast to manage your sitemap. Then try clicking on the Sitemap button to see how it looks. But unfortuantely, it says “Page not found”

Here are some steps which will help you fix the issue and successfully submit your sitemap to Google Webmaster:

  1. Reset Permalinks : Go to Admin > Settings > Permalinks and just save the permalink structure without editing it. This alone can fix the issue.
  2. Add sitemap to .htaccess: Sometimes WordPress might be searching for a physical URL which does not exist. Go to your .htaccess file through your File Manager in Cpanel or downloading the .htaccess file using a FTP Manager like Filezilla. .htaccess file should be in the root of your website usually public_html folder.
    Once you open .htaccess using an editor like Notepad or Dreamweaver, add the below code just above the WordPress code:
    [box type=”note”]# Yoast SEO – XML Sitemap Rewrite Fix
    RewriteEngine On
    RewriteBase /
    RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
    RewriteRule ^locations.kml$ /index.php?sitemap=wpseo_local_kml [L]
    RewriteRule ^geo_sitemap.xml$ /index.php?sitemap=geo [L]
    RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
    RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L]
    # END Yoast SEO – XML Sitemap Rewrite Fix
    [/box]