Hello,
We apologize for the issue you are facing with your sitemap not updating automatically. It does sound like it could be a caching problem.
To exclude your sitemap.xml
from being cached by Varnish, you can add the following rule in the exclusion settings:
sitemap.xml
This should prevent Varnish from caching your sitemap file. Since you mentioned that for folders you need to use /folder/
and for files just the filename, using sitemap.xml
without any slashes should work for your case.
Additionally, if you are using Cloudflare, it does not cache sitemaps by default, but if you have made changes that cause your sitemaps to be cached, you can set a page rule to exclude your sitemap from being cached. Here’s how:
- Log into your Cloudflare account and select your website.
- Navigate to Rules → Page Rules and click Create Page Rule.
- In the Page Rules settings, paste your sitemap URL in the URL field.
- Select Cache Level and Bypass in the dropdown menus.
- Click Save and Deploy Page Rule.
If you continue to experience issues after making these changes, 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:
How To Exclude Rank Math Sitemaps from Caching » Rank Math
Hello,
Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.
In order to exclude your sitemap from caching, please follow the steps below:
1. 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/
2. If the above step doesn’t seem to work, kindly apply the following filter to your site.
add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
Here’s how you can add filter/hook to your WordPress site:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
Hope that helps and please don’t hesitate to let us know if you have any other questions.
Thank you.
I excluded it from server and see what will happen.
Hello,
That is fine.
Please update us when you check the sitemap. You can also share the sitemap URL with us so we can check as well.
We look forward to hearing from you.
Thank 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.