How do I prevent sitemaps from being cached?

Last update: 06 January, 2018

Please add an exclusion for the sitemap files to your cache plugin. The steps vary by cache plugin so please select your cache plugin below. When finished be sure to clear your caching from your plugin, theme, server, browser, or CDN such as Cloudflare. If you are not sure how to clear your server caching, please speak with your host provider. If you need to clear your browser caching this guide may help: How to clear my browser's cache?.

Table of Contents

W3 Total Cache

If you're using the setting "Do not process 404 errors for static objects with WordPress", please add the following exception:


If you're using W3 Total Cache to minify your pages, please input the same exception as above to the "Never minify the following pages:" setting under Minify > Advanced:

WP Super Cache

Go to Settings  > WP Super Cache and click on the Advanced tab.  Scroll down to the section where it says “Add here strings (not a filename) that forces a page not to be cached” and enter the following string in the box:


WP Rocket

Go to WP Rocket > Advanced Options and scroll down to the section where it says “Never cache the following pages”.  Enter the following strings in the box:


Other Cache Plugin or Method

If you are using a different plugin or caching is done at the server level then contact the plugin developer or your hosting company for support.

Exclude the following formats:


Was this article helpful? ·