{"id":2660,"date":"2024-07-29T11:47:14","date_gmt":"2024-07-29T15:47:14","guid":{"rendered":"https:\/\/www.tracemyip.org\/learn\/?p=2660"},"modified":"2025-06-09T06:04:55","modified_gmt":"2025-06-09T10:04:55","slug":"exclude-wordpress-content-from-being-cached-by-caching-plugins","status":"publish","type":"post","link":"https:\/\/www.tracemyip.org\/learn\/exclude-wordpress-content-from-being-cached-by-caching-plugins-2660\/","title":{"rendered":"Exclude WordPress content from being cached by caching plugins"},"content":{"rendered":"<div class=\"ds-markdown ds-markdown--block\">\n<p>If you don\u2019t want certain parts of your website (like specific pages, content, or plugins) to be saved in the cache, you need to tell the caching plugin to skip those parts.<\/p>\n<p>Specifically, to exclude any page content, script file output, or plugin output from being cached by various caching plugins, you typically need to configure the cache plugin to ignore or bypass specific <strong>URLs<\/strong>, URLs with certain <strong>parameters<\/strong>, or <strong>entire sections<\/strong> of your site, such as those with a category name like &#8220;<strong>product-reviews<\/strong>&#8221; in the URL, where the cache plugin operates.<\/p>\n<p>Most of these plugins that serve cached content have a configuration option where you can specify a matching script name, such as &#8220;<strong>script-name.php<\/strong>&#8221; or <strong>any-string<\/strong> that appears in the <strong>URL<\/strong>, like &#8220;www.example.com\/<strong>any-string<\/strong>\/products\/&#8221;. This prevents the content from being stored in memory, ensuring only the most recent content is served. This is particularly useful in situations where the content is automatically generated or in situations where <a href=\"https:\/\/www.tracemyip.org\/learn\/wp-fastest-cache-plugin-disables-analytics-tracking-2417\/\">WP Fastest Cache plugin causes issues<\/a> with analytics <a href=\"https:\/\/www.tracemyip.org\/tools\/website-visitors-counter-traffic-tracker-statistics\/\" data-internallinksmanager029f6b8e52c=\"68\" title=\"visitor tracking, visitor IP tracker\">visitor tracking<\/a>.<\/p>\n<\/div>\n<h3>Here\u2019s a general guide for popular caching plugins<\/h3>\n<p style=\"padding: 10px 0;\"><strong><a href=\"https:\/\/www.tracemyip.org\/tools\/website-visitors-counter-traffic-tracker-statistics\/index.php?sto=1&amp;refLinkID=WPLearn_tracemyip_signup_link_1\" target=\"_blank\" rel=\"noopener\">\ud83d\udcc8 Sign Up<\/a><\/strong> now to <strong>instantly<\/strong> track <a href=\"https:\/\/www.tracemyip.org\/learn\/how-to-build-a-website-for-visitors-optimization-2814\/\" data-internallinksmanager029f6b8e52c=\"69\" title=\"How to Build a Website for Visitors: Understanding Needs and Optimizing for Success\">website visitors<\/a> IPs!<\/p>\n<h2>1. WP Super Cache<\/h2>\n<ul>\n<li><strong>Exclude a Specific URL:<\/strong>\n<ol>\n<li>Go to <strong>Settings<\/strong> &gt; <strong>WP Super Cache<\/strong>.<\/li>\n<li>Click on the <strong>Advanced<\/strong> tab.<\/li>\n<li>Scroll down to <strong>Accepted Filenames &amp; Rejected URIs<\/strong>.<\/li>\n<li>Add the URL or part of the URL related to the plugin you want to exclude under <strong>Add here to exclude<\/strong>.<\/li>\n<\/ol>\n<\/li>\n<li><strong>Exclude by User-Agent or Query String:<\/strong>\n<ol>\n<li>Scroll down to <strong>Rejected User Agents<\/strong> or <strong>Rejected URIs<\/strong>.<\/li>\n<li>Add specific user agents or query strings related to the plugin.<\/li>\n<\/ol>\n<\/li>\n<li>\n<p><strong>Example<\/strong> for <strong>WP Super Cache<\/strong>:<\/p>\n<pre><code>Add here to exclude:\r\n\/wp-admin\/admin-ajax.php<\/code><\/pre>\n<\/li>\n<\/ul>\n<h2>2. W3 Total Cache<\/h2>\n<ul>\n<li><strong>Exclude Specific Pages or URLs:<\/strong>\n<ol>\n<li>Go to <strong>Performance<\/strong> &gt; <strong>Page Cache<\/strong>.<\/li>\n<li>Scroll down to the <strong>Advanced<\/strong> section.<\/li>\n<li>Add URLs or patterns to the <strong>Never cache the following pages<\/strong> field.<\/li>\n<\/ol>\n<\/li>\n<li><strong>Exclude by Cache Method:<\/strong>\n<ol>\n<li>Go to <strong>Performance<\/strong> &gt; <strong>Cache User<\/strong>.<\/li>\n<li>Configure settings to exclude specific pages or URLs if applicable.<\/li>\n<li>\n<p><strong>Example<\/strong> for <strong><a href=\"https:\/\/www.tracemyip.org\/learn\/w3-total-cache-and-visitor-tracking-and-analytics-issue-2442\/\" data-internallinksmanager029f6b8e52c=\"22\" title=\"W3 Total Cache and visitor tracking and analytics issue\">W3 Total Cache<\/a><\/strong>:<\/p>\n<pre><code>Never cache the following pages:\r\n\/wp-admin\/admin-ajax.php<\/code><\/pre>\n<\/li>\n<\/ol>\n<\/li>\n<li><strong>See more info<\/strong> for <a href=\"https:\/\/www.tracemyip.org\/learn\/w3-total-cache-and-visitor-tracking-and-analytics-issue-2442\/\" target=\"_blank\" rel=\"noopener\">W3 Total Cache setup<\/a> to bypass cache<\/li>\n<\/ul>\n<h2>3. WP Rocket<\/h2>\n<ul>\n<li><strong>Exclude URLs:<\/strong>\n<ol>\n<li>Go to <strong>Settings<\/strong> &gt; <strong>WP Rocket<\/strong>.<\/li>\n<li>Click on the <strong>Advanced Rules<\/strong> tab.<\/li>\n<li>Under <strong>Never Cache URL(s)<\/strong>, add the URLs or URL patterns to be excluded from caching.<\/li>\n<\/ol>\n<\/li>\n<li><strong>Exclude by Cache Settings:<\/strong>\n<ol>\n<li>Under <strong>Cache<\/strong> settings, you can exclude pages, cookies, or user agents related to the plugin.<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<h2>4. Cache Enabler<\/h2>\n<ul>\n<li><strong>Exclude Specific URLs:<\/strong>\n<ol>\n<li>Go to <strong>Settings<\/strong> &gt; <strong>Cache Enabler<\/strong>.<\/li>\n<li>Add the URL or URL patterns to the <strong>Do not cache pages containing<\/strong> field.<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<h2>5. WP Fastest Cache<\/h2>\n<ul>\n<li><strong>Exclude Specific URLs:<\/strong>\n<ol>\n<li>Go to <strong><a href=\"https:\/\/www.tracemyip.org\/learn\/wp-fastest-cache-plugin-disables-analytics-tracking-2417\/\" data-internallinksmanager029f6b8e52c=\"24\" title=\"WP Fastest Cache plugin disables analytics tracking\">WP Fastest Cache<\/a><\/strong> in your <a href=\"https:\/\/www.tracemyip.org\/learn\/wordpress-visitor-tracking-plugin-1382\/\" data-internallinksmanager029f6b8e52c=\"18\" title=\"WordPress visitor tracking plugin\">WordPress<\/a> admin dashboard.<\/li>\n<li>Click on the <strong>Exclude<\/strong> tab.<\/li>\n<li>In the <strong>Exclude Pages<\/strong> section, add the URLs you want to exclude from caching.<\/li>\n<\/ol>\n<\/li>\n<li><strong>Exclude by User-Agent:<\/strong>\n<ol>\n<li>In the same <strong>Exclude<\/strong> tab, add specific user agents if needed.<\/li>\n<\/ol>\n<\/li>\n<li>Check out more info on <a href=\"https:\/\/www.tracemyip.org\/learn\/wp-fastest-cache-plugin-disables-analytics-tracking-2417\/\" target=\"_blank\" rel=\"noopener\">settings for WP Fastest Cache<\/a><\/li>\n<\/ul>\n<h2>6. LiteSpeed Cache<\/h2>\n<ul>\n<li><strong>Exclude URLs or Parameters:<\/strong>\n<ol>\n<li>Go to <strong><a href=\"https:\/\/www.tracemyip.org\/learn\/litespeed-cache-for-wordpress-and-visitor-tracking-and-analytics-issues-2433\/\" data-internallinksmanager029f6b8e52c=\"23\" title=\"LiteSpeed Cache for WordPress and visitor tracking and analytics issues\">LiteSpeed Cache<\/a><\/strong> &gt; <strong>Cache<\/strong>.<\/li>\n<li>Click on the <strong>Exclude<\/strong> tab.<\/li>\n<li>Add URLs or parameters to the <strong>Never Cache URLs<\/strong> or <strong>Never Cache Cookies<\/strong> fields.<\/li>\n<\/ol>\n<\/li>\n<li>Here are more detailed steps for <a href=\"https:\/\/www.tracemyip.org\/learn\/litespeed-cache-for-wordpress-and-visitor-tracking-and-analytics-issues-2433\/\" target=\"_blank\" rel=\"noopener\">LiteSpeed Cache setup<\/a><\/li>\n<\/ul>\n<h2>7. Comet Cache<\/h2>\n<ul>\n<li><strong>Exclude Specific URLs:<\/strong>\n<ol>\n<li>Go to <strong>Comet Cache<\/strong> &gt; <strong>Settings<\/strong>.<\/li>\n<li>Click on the <strong>Advanced<\/strong> tab.<\/li>\n<li>In the <strong>Never Cache URLs<\/strong> section, add the URLs or URL patterns to exclude from caching.<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<h2>5. Other Caching Plugins<\/h2>\n<ul>\n<li>Most caching plugins have similar features to exclude specific URLs, paths, or user agents from caching. Check the documentation or settings for the cache plugin you are using to find the appropriate configuration options.<\/li>\n<li>\n<h4>Check out additional guides for the following<\/h4>\n<ul>\n<li><a href=\"https:\/\/www.tracemyip.org\/learn\/disable-rocket-loader-to-enable-visitor-ip-tracking-936\/\"><strong>Rocket Loader<\/strong> page cache plugin<\/a><\/li>\n<li><a href=\"https:\/\/www.tracemyip.org\/learn\/autoptimize-wordpress-plugin-and-visitor-tracking-and-analytics-issues-2452\/\"><strong>Autoptimize<\/strong> content cache plugin<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>General Approach:<\/h2>\n<ul>\n<li><strong>Identify Plugin Paths or URLs:<\/strong> Determine which URLs or query parameters are used by the plugin. This could be specific to admin pages, AJAX requests, or custom endpoints.<\/li>\n<li><strong>Add Exclusions:<\/strong> Use the settings or configuration options in your caching plugin to exclude these URLs or parameters. Each caching plugin will have a slightly different interface, but the principle remains the same.<\/li>\n<li><strong>Clear Caches:<\/strong> After making changes, clear or purge the cache to ensure the new settings take effect.<\/li>\n<li><strong>Test:<\/strong> Test your site to confirm that the plugin functionality is working as expected and that the relevant parts are not cached.<\/li>\n<li><strong>For additional detailed guides<\/strong> on fixing issues with site elements being cached, please see <a href=\"https:\/\/www.tracemyip.org\/learn\/website-caching-cdn-and-website-analytics-and-visitor-tracking-issues-2422\/\"><strong>this guide<\/strong><\/a>.<\/li>\n<\/ul>\n<p><strong>\ud83d\udcc4 \ud83d\udd17<\/strong> <a href=\"https:\/\/www.tracemyip.org\/support\/files\/tracemyip-visitor-analytics-ip-tracking-control.zip\"><span style=\"color: #3366ff;\"><strong>Download<\/strong><\/span><\/a> the latest version of WordPress <strong>UnFiltered Stats<\/strong> plugin. To install, <strong>login<\/strong> to <strong>WordPress<\/strong> &gt; Add Plugin &gt; Upload Plugin or download from WP plugin directory.<\/p>\n<p style=\"padding: 10px 0;\"><strong>\ud83c\udf0d Who visits your website?<\/strong> <strong><a href=\"https:\/\/www.tracemyip.org\/tools\/codereg.php?rgtype=4684NR-IPIB&amp;ntc=1&amp;adDj=1&amp;refLinkID=WPLearn_tracemyip_signup_link_2\" target=\"_blank\" rel=\"noopener\">Sign Up<\/a><\/strong> now to find out instantly!<\/p>\n<hr \/>\n<p><strong>REFERENCES<\/strong><\/p>\n<ol start=\"1\">\n<li>\n<p><strong>&#8220;How to Exclude Pages from Caching in WordPress&#8221; &#8211; WPBeginner<\/strong><br \/>\nDescription: This guide by WPBeginner provides step-by-step instructions for excluding specific pages or content from caching in WordPress. It covers popular caching plugins like WP Rocket, W3 Total Cache, and WP Super Cache.<br \/>\nURL: https:\/\/www.wpbeginner.com\/<\/p>\n<\/li>\n<li>\n<p><strong>&#8220;Advanced Caching: Excluding Content from Cache&#8221; &#8211; WP Rocket Documentation<\/strong><br \/>\nDescription: This official documentation by WP Rocket explains how to exclude specific URLs, cookies, or user agents from caching. It also provides examples of custom code snippets for advanced users.<br \/>\nURL: https:\/\/docs.wp-rocket.me\/article\/54-exclude-pages-from-the-cache<\/p>\n<\/li>\n<li>\n<p><strong>&#8220;Optimizing WordPress Caching: What Not to Cache&#8221; &#8211; Kinsta Blog<\/strong><br \/>\nDescription: This article by Kinsta discusses the types of content that should not be cached, such as shopping carts, user-specific data, and dynamic elements. It also provides tips for configuring caching plugins to exclude such content.<br \/>\nURL: https:\/\/kinsta.com\/blog\/wordpress-caching<\/p>\n<\/li>\n<\/ol>\n<div style=\"clear:both\"><\/div>","protected":false},"excerpt":{"rendered":"<p>If you don\u2019t want certain parts of your website (like specific pages, content, or plugins) to be saved in the cache, you need to tell the caching plugin to skip those parts. Specifically, to exclude any page content, script file output, or plugin output from being cached by various caching&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[83,157],"tags":[159,160,158],"class_list":["post-2660","post","type-post","status-publish","format-standard","hentry","category-website-development","category-wordpress-workflow","tag-cache","tag-plugins","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.tracemyip.org\/learn\/wp-json\/wp\/v2\/posts\/2660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tracemyip.org\/learn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tracemyip.org\/learn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tracemyip.org\/learn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tracemyip.org\/learn\/wp-json\/wp\/v2\/comments?post=2660"}],"version-history":[{"count":8,"href":"https:\/\/www.tracemyip.org\/learn\/wp-json\/wp\/v2\/posts\/2660\/revisions"}],"predecessor-version":[{"id":3026,"href":"https:\/\/www.tracemyip.org\/learn\/wp-json\/wp\/v2\/posts\/2660\/revisions\/3026"}],"wp:attachment":[{"href":"https:\/\/www.tracemyip.org\/learn\/wp-json\/wp\/v2\/media?parent=2660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tracemyip.org\/learn\/wp-json\/wp\/v2\/categories?post=2660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tracemyip.org\/learn\/wp-json\/wp\/v2\/tags?post=2660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}