trackmyip

Exclude WordPress content from being cached by caching plugins

To exclude any content, part of content or a plugin from being cached by various caching plugins, you typically need to configure the cache plugin to ignore or bypass specific URLs, parameters, or parts of your site where the plugin operates.

Here’s a general guide for popular caching plugins

Sign up to instantly track website visitors IPs!

1. WP Super Cache

  • Exclude a Specific URL:
    1. Go to Settings > WP Super Cache.
    2. Click on the Advanced tab.
    3. Scroll down to Accepted Filenames & Rejected URIs.
    4. Add the URL or part of the URL related to the plugin you want to exclude under Add here to exclude.
  • Exclude by User-Agent or Query String:
    1. Scroll down to Rejected User Agents or Rejected URIs.
    2. Add specific user agents or query strings related to the plugin.
  • Example for WP Super Cache:

    Add here to exclude:
    /wp-admin/admin-ajax.php

2. W3 Total Cache

  • Exclude Specific Pages or URLs:
    1. Go to Performance > Page Cache.
    2. Scroll down to the Advanced section.
    3. Add URLs or patterns to the Never cache the following pages field.
  • Exclude by Cache Method:
    1. Go to Performance > Cache User.
    2. Configure settings to exclude specific pages or URLs if applicable.
    3. Example for W3 Total Cache:

      Never cache the following pages:
      /wp-admin/admin-ajax.php
  • See more info for W3 Total Cache setup to bypass cache

3. WP Rocket

  • Exclude URLs:
    1. Go to Settings > WP Rocket.
    2. Click on the Advanced Rules tab.
    3. Under Never Cache URL(s), add the URLs or URL patterns to be excluded from caching.
  • Exclude by Cache Settings:
    1. Under Cache settings, you can exclude pages, cookies, or user agents related to the plugin.

4. Cache Enabler

  • Exclude Specific URLs:
    1. Go to Settings > Cache Enabler.
    2. Add the URL or URL patterns to the Do not cache pages containing field.

5. WP Fastest Cache

  • Exclude Specific URLs:
    1. Go to WP Fastest Cache in your WordPress admin dashboard.
    2. Click on the Exclude tab.
    3. In the Exclude Pages section, add the URLs you want to exclude from caching.
  • Exclude by User-Agent:
    1. In the same Exclude tab, add specific user agents if needed.
  • Check out more info on settings for WP Fastest Cache

6. LiteSpeed Cache

  • Exclude URLs or Parameters:
    1. Go to LiteSpeed Cache > Cache.
    2. Click on the Exclude tab.
    3. Add URLs or parameters to the Never Cache URLs or Never Cache Cookies fields.
  • Here are more detailed steps for LiteSpeed Cache setup

7. Comet Cache

  • Exclude Specific URLs:
    1. Go to Comet Cache > Settings.
    2. Click on the Advanced tab.
    3. In the Never Cache URLs section, add the URLs or URL patterns to exclude from caching.

5. Other Caching Plugins

  • 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.
  • Check out additional guides for the following

General Approach:

  • Identify Plugin Paths or URLs: Determine which URLs or query parameters are used by the plugin. This could be specific to admin pages, AJAX requests, or custom endpoints.
  • Add Exclusions: 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.
  • Clear Caches: After making changes, clear or purge the cache to ensure the new settings take effect.
  • Test: Test your site to confirm that the plugin functionality is working as expected and that the relevant parts are not cached.
  • For additional detailed guides on fixing issues with site elements being cached, please see this guide.

Who visits your website? Sign up to find out!