Sitemap doesn't update

WP Rocket automatically excludes sitemaps from cache and optimizations, so it most cases WP Rocket is not related to your sitemap(s) not being updated as expected.

There are two reasons why a sitemap isn't updated:

Page caching 

WP Rocket won't cache the sitemap if it's extension is XML, which is the norm for sitemaps. The recommendation is to check for other cache layers running on your site that might be caching your sitemap.

It's worth mentioning that you could try entering the sitemap's URL into the Never Cache URLs setting on the Advanced Rules tab. See Exclude Pages from the Cache.

Browser caching

A sitemap can also be cached on the browser if there are any rules for this. 

In order to make sure this is not the case, please check your .htaccess file (if your server uses one) and remove any browser cache rules for XML files.

You should look for and remove rules such as:

  • ExpiresByType text/xml "access plus 4 months"
  • ExpiresByType application/xml "access plus 1 week"

โš ๏ธ Other cache layers such as Cloudflare can also affect this, and you may need to make similar exclusions or adjustments for each one.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.