-
https://batapalali.com.lk/sitemap_index.xml
this sitemap goes to 404 page. I tried everything I can find. Unable to fix.
Can you help me out?
-
Hello, we apologize for the issue you are facing with your sitemap returning a 404 error. Here are some steps you can take to troubleshoot and potentially fix the issue:
-
Flush Permalinks: Sometimes, simply flushing the permalinks can resolve 404 errors. Go to your WordPress dashboard, navigate to Settings → Permalinks, and click Save Changes without making any changes. This action refreshes the permalink structure.
-
Check Your Sitemap URL: Ensure that you are using the correct sitemap URL, which should be `https://rankmath.com/kb/check-plugin-conflicts/. If you have manually created a sitemap, make sure it is located in the root folder of your WordPress installation.
-
Server Configuration: If you are using an Apache server, check your
.htaccessfile for the following rewrite rules:# 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 RulesIf you are using Nginx, ensure your configuration includes:
# 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 generation. You can use the Health Check plugin to identify any conflicts.
-
Ensure Posts Are Set to Index: If all your posts are set to noindex, your sitemap may appear empty. Go to Rank Math SEO → Titles & Meta and ensure that the Index checkbox is enabled for your posts.
-
Clear Cache: If you have a caching plugin installed, clear your website cache and try accessing the sitemap again.
If you’ve tried all these steps and the issue persists, please reply to this ticket, and a human agent from the Rank Math Support team will assist you further.
Sources:
Rank Math Sitemap Issues and Their Fixes » Rank Math
Troubleshooting the “Couldn’t Fetch” Error in Google Search Console » Rank MathHello,
@Blogging You should exclude your sitemap from being cached to prevent this issue in the future.
Please follow these steps to flush your sitemap cache:
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/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.
-
The ticket ‘sitemap_index.xml goes to 404’ is closed to new replies.