-
Why is my website’s sitemap not working? My website URL is https://sadiyaafrin.com/. Please fix it as soon as possible.
-
Hello,
We apologize for the issue you are facing with your website’s sitemap. There could be several reasons why your sitemap is not working. Here are some common issues and their fixes:
-
Blank or White Page: If your sitemap shows a blank page, it may be due to a plugin conflict or server configuration issue.
-
404 Error: If Rank Math does not create a sitemap and throws a 404 error, ensure that the Sitemap module is enabled in Rank Math settings.
-
Server Configuration: If you are using an Apache web server, you may need to add specific rewrite rules to your
.htaccess
file:# 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
For Nginx servers, you would need to add the following to your Nginx config file:
# 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
-
Blocked by robots.txt: Ensure that your sitemap URL is not blocked in your
robots.txt
file. You can check this in the Rank Math settings under General Settings → robots.txt. -
Custom Canonicals: If you have set custom canonical URLs for your posts, they may not appear in the sitemap. Consider removing those custom canonicals to allow Rank Math to generate them correctly.
For a detailed guide on fixing sitemap issues, you can refer to our article here.
If these solutions do not resolve the issue, we recommend replying to this ticket, and a human agent from our support team will assist you further. Thank you for your patience!
Sources:
Rank Math Sitemap Issues and Their Fixes » Rank MathI am facing a 404 error, and I did enable the sitemap. But still it is not working
Hello,
In this case, 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 ‘Why is my website’s sitemap not working?’ is closed to new replies.