-
Hello,
Google Search Console gives sitemap_index.xml errorBut /post-sitemap.xml and /page-sitemap.xml fetch it successfully.
I reviewed these resources but there was no solution,
https://rankmath.com/kb/fix-sitemap-issues/
https://rankmath.com/kb/sitemap-404-error/
https://wordpress.org/support/topic/sitemap-404-error-13/
-
Hello,
We apologize for the issue you are facing with the
sitemap_index.xmlreturning a 404 error. Since you mentioned that/post-sitemap.xmland/page-sitemap.xmlare fetching successfully, it indicates that the individual sitemaps are working, but there might be an issue with the main sitemap index.Here are a few steps you can take to resolve the 404 error for
sitemap_index.xml:-
Flush Permalinks: Sometimes, simply flushing the permalinks can resolve this issue. To do this, go to your WordPress admin area, navigate to Settings → Permalinks, and click the “Save Changes” button without making any changes. This action refreshes the permalink structure.

-
Check .htaccess File: If you are using an Apache server, ensure that your
.htaccessfile has the correct rewrite rules for Rank Math sitemaps. You can add the following code to your.htaccessfile:# START of Rank Math Sitemap Rewrite Rules 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] RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L] # END of Rank Math Sitemap Rewrite Rules -
Nginx Configuration: If you are using Nginx, ensure that your Nginx configuration file has the appropriate rewrite rules for Rank Math sitemaps:
# START Nginx Rewrites for Rank Math Sitemaps rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last; rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last; rewrite ^/([a-z]+)?-sitemap.xsl$ /index.php?xsl=$1 last; # END Nginx Rewrites for Rank Math Sitemaps -
Check for Plugin Conflicts: Sometimes, other plugins can interfere with the sitemap functionality. You can use the Health Check plugin to check for any conflicts.
If these steps do not resolve the issue, please reply to this ticket, and a human agent from the Rank Math Support team will assist you further. Thank you for raising this concern!
Sources:
Rank Math Sitemap Issues and Their Fixes » Rank MathHello,
Thank you for contacting support.
Can you please follow these steps?
1. Flush the Sitemap cache by following this video screencast:
https://i.rankmath.com/pipRDp2. Exclude the Sitemap files of the Rank Math plugin in your caching plugin. The cache could be via a plugin or from the server. For plugins or Cloudflare, please follow this article:
https://rankmath.com/kb/exclude-sitemaps-from-caching/That should fix the issue.
Please let us know if that does not. We are here to assist.
Thanks for your answer. I’m using Wp Rocket here and have caching disabled, I’m not using Cloudflare. I followed the steps in the video you sent, but it still didn’t work.
Thanks sincerely
Hello,
The website you provided in the sensitive data section does not exist. Please double-check to ensure there are no typos.
We look forward to hearing from you.
Hello,
Since the issue persists, try disabling the transient cache for the sitemap. To do this, you need to add a small piece of code to your site. The PHP code you need to add is this:
/** * Filter if XML sitemap transient cache is enabled. * * @param boolean $unsigned Enable cache or not, defaults to true */ add_filter( 'rank_math/sitemap/enable_caching', '__return_false');If you’re not sure how to add this code, you can follow this guide: https://rankmath.com/kb/wordpress-hooks-actions-filters/.
After you add the code, please clear any cache on your site or server and check your XML sitemap again. If you’re still facing issues with the sitemap, please let us know – we are happy to investigate further.
Thanks.
Hello,
We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.
Please do take a complete backup of your website before sharing the information with us.
It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:
https://wordpress.org/plugins/temporary-login-without-password/
You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):
https://wordpress.org/plugins/wp-security-audit-log/
We really look forward to helping you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hello,
We’ve checked your site, and it seems that you don’t have any posts published yet. Also, the single page on your site is set to noindex.
Please publish some posts and pages, and ensure that they are set to index. Once done, your sitemap should be generated as well.
Let us know how this goes.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.
-
The ticket ‘sitemap_index.xml Not Found (404)’ is closed to new replies.