Hello,
We apologize for the issue you are facing with your sitemap not being found. It seems like there might be a few reasons for this problem. Here are some steps you can take to troubleshoot and potentially resolve the issue:
-
Check if the Sitemap is Enabled: Ensure that the Sitemap module is enabled in Rank Math. You can do this by going to Rank Math Dashboard → Sitemap Settings.
-
Access the Sitemap Directly: Try accessing your sitemap directly by visiting https://yourdomainname.com/sitemap_index.xml. Replace yourdomainname.com with your actual domain name. If this URL returns a 404 error, it indicates that the sitemap is not being generated correctly.
-
Rewrite Rules: If you are using an Apache server, you may need to add rewrite rules to your .htaccess file. Here’s a sample code you can add:
# 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
If you are using Nginx, you will need to add similar rules to your Nginx configuration file.
-
Check for Plugin Conflicts: Sometimes, other plugins can conflict with Rank Math. You can use the Health Check plugin to identify any conflicts.
-
Clear Cache: If you are using a caching plugin, make sure to clear the cache and exclude the sitemap from caching.
-
Check robots.txt: Ensure that your robots.txt file is not blocking access to your sitemap. You can check this in Rank Math SEO → General Settings → robots.txt.
If after trying these steps you still cannot find your sitemap, please reply to this ticket, and a human agent from the Rank Math Support team will assist you further.
Thank you for bringing this concern to our attention!
Sources:
Rank Math Sitemap Issues and Their Fixes » Rank Math
Hello,
We’ve checked your sitemap, and it is already opening fine.
To fix this issue permanently, please follow these steps to flush your sitemap cache:
1. Flush the Sitemap cache by following this video screencast:
https://i.rankmath.com/pipRDp
2. 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/
3. Disable the transient cache for the sitemap by applying this filter. This will make sure that your XML sitemap always reflects the latest changes on your site:
/**
* 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/
Looking forward to helping you.
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.