Hello,
I’m sorry to hear that you are facing issues with your sitemap. It seems like the sitemap link works within the Rank Math SEO settings but displays errors when accessed separately in a new tab.
Based on the issue you described, it sounds like there might be a problem with how the sitemap is being generated or accessed. To troubleshoot this issue further, I recommend following these steps:
-
Flush Permalinks: Sometimes, refreshing the permalinks can resolve sitemap-related issues. You can do this by going to your WordPress admin area, navigating to Settings → Permalinks, and clicking the "Save Changes" button.
-
Check for Blank Spaces: Ensure there are no blank spaces before the XML declaration in your sitemap file. These spaces can cause errors. You can refer to this guide for more information.
-
Disable Cache: If you have any caching plugins active, try disabling them temporarily to see if they are causing conflicts with the sitemap functionality.
If after trying these steps the issue persists, please reply to this ticket, and a human agent from the Rank Math Support team will assist you further.
Thank you for bringing this to our attention. We appreciate your patience as we work to resolve this issue for you.
Best regards.
Sources:
Rank Math Sitemap Issues and Their Fixes » Rank Math
Troubleshooting the “Couldn’t Fetch” Error in Google Search Console » Rank Math
Hi,
When I disabled the cache plugin, the sitemap is loading properly.
I want to activate the cache plugin (currently using W3 Total Cache). So in this case, what to do to make the sitemap load as expected? Any solution?
Thank you.
Hello,
Thank you for your query and we are so sorry about the trouble this must have caused.
From your description, it seems the issue is stemming in caching.
Please follow the steps below:
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. Apply the following filter code to your site.
add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
Here’s how you can add filter to your WordPress site:https://rankmath.com/kb/wordpress-hooks-actions-filters/
Let us know how that goes. Looking forward to helping you.
The Step 2 worked. Thank you so much, Jeremy.
Hello,
We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.
If you don’t mind me asking, could you please leave us a review (if you haven’t already) on
https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post
about your overall experience with Rank Math? We appreciate your time and patience.
If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.