How to Exclude XML Sitemaps from Cache in WordPress/WordPress

Using caching plugins is possibly the easiest way to speed up your WordPress site. However, you may eventually get your site cached, and that’s not a good idea.

An XML sitemap should always reflect your site’s latest posts and urls so that search engines get the latest version of anything up to date.

In this post, I want to share with you how to exclude and prevent XML sitemaps from being cached (accidentally) by some of the most popular WordPress Cache plugins.

Total W3 . Cache

To exclude XML Sitemaps from the cache using the W3 Total Cache plugin, here’s what you do:

  1. Go Performance > Page Cache.
  2. Scroll down to the section labeled “Never archive the following pages“. Then enter the following lines in the box:
  3. [a-z0-9 _  -] * sơ đồ trang web [a-z0-9 _  -] * . (xml | xsl | html) (. gz)? ([a-z0-9 _  -] *?) sơ đồ trang web ([a-z0-9 _  -] *)? . xml 

If you are using Minimize, open Efficiency > Minimize and enter the same line in the field saying “Never minimize the following pages“.

Last but not least, go to Efficiency > Browser cache and make sure the same lines are in “404 . error exception list” part.

Super WP Cache

To exclude XML sitemaps from the cache with the WP Super Cache plugin, here’s what you do:

  1. Go Setting > Super WP Cache. Open Advanced Tab.
  2. Look for the section labeled “Add string here (not filename) to force a page not to be cached .”And enter the following:
  3. [a-z0-9 _  -] * sơ đồ trang web [a-z0-9 _  -] * . (xml | xsl | html) (. gz)? ([a-z0-9 _  -] *?) sơ đồ trang web ([a-z0-9 _  -] *)? . xml

WP . rocket

If you use the WP Rocket plugin and you want to exclude the XML sitemap from the cache, here’s what you do:

  1. Go Settings > WP Rocket > Advanced options.
  2. Scroll down the block with the words: “Never archive the following pages“. Enter these lines in the field:
  3. [a-z0-9 _  -] * sơ đồ trang web [a-z0-9 _  -] * . (xml | xsl | html) (. gz)? ([a-z0-9 _  -] *?) sơ đồ trang web ([a-z0-9 _  -] *)? . xml 

Last, Ched All sent you details about the topic “How to Exclude XML Sitemaps from Cache in WordPress/WordPress
❤️️”.Hope with useful information that the article “How to Exclude XML Sitemaps from Cache in WordPress/WordPress
” It will help readers to be more interested in “How to Exclude XML Sitemaps from Cache in WordPress/WordPress
[ ❤️️❤️️ ]”.

Read More:   How to increase Windows Explorer default thumbnail size for photos / Windows XP

Posts “How to Exclude XML Sitemaps from Cache in WordPress/WordPress
” posted by on 2023-01-17 17:22:28. Thank you for reading the article at Chedall.com

Back to top button