Wordpress Sitemap XML Error While Using With Custom Permalinks

I have developed a website on wordpress where I used Yoast SEO plugin ( for SEO and Custom Permalinks ( to customize my links.

Now issue is neither Yoast SEO nor Google Sitemap is able to generate sitemap XML on my website, it returns 404 Error. If i disable Custom Permalinks plugin then it works perfectly.

I even tried changing my Yoast SEO Plugin to All in One SEO but issue remains same, Sitemap only works if custom permalinks is disabled which I can not do because I created custom post type and i must use it.

Did any one use this combination and fixed such issue?


Manoj Soni



If you use Yoast SEO Plugin they show on their site how to fix it here -

on an Apache server but make sure you put this in the .htacess before the WordPress code that is in there.

# 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