How to Resolve WP Rocket Caching Issues With Captain Compliance
WP Rocket is a popular WordPress caching and performance optimization plugin.
When used together with Captain Compliance, some sites may experience issues related to script execution and user interaction.
Summary of the Issue
On WordPress sites using both Captain Compliance and WP Rocket, WP Rocket’s caching and optimization features can interfere with Captain Compliance’s consent banner script. When this occurs, the cookie banner may render correctly but fail to respond to user interactions (for example, Accept, Reject, or Preferences buttons appear “frozen” or unclickable).
This issue can be verified by visiting a test URL that forces a fresh load, such as www.yourwebsite.com?captaincompliance
As of January 2026, this is a known issue within WP Rocket. In some cases, WP Rocket’s built-in JavaScript exclusion and exception settings do not consistently resolve the problem.
WP Rocket is aware of the issue and is actively working toward a permanent fix, which will be released in a future WP Rocket update.
Current Recommended Solution
Until an official fix is released, WP Rocket recommends using a helper plugin that reverts the Delay JavaScript Execution script to a previous version.
Helper Plugin: WP Rocket – Change Delay JS Execution Script
This solution has been successfully used by Captain Compliance customers.
In many cases, simply installing the helper plugin resolves the issue without requiring any additional Captain Compliance-specific exclusions or configuration.
Installation Instructions
Please note: while the basic installation steps are outlined below, you should always follow WP Rocket’s official documentation and guidance.
Step 1: Download the helper plugin
Click the download link provided by WP Rocket.
This will download a .zip file to your computer.
Step 2: Upload and activate the plugin
Log in to your WordPress admin dashboard.
Go to Plugins, then Add New.
Click Upload Plugin.
Click Choose File and select the .zip file you downloaded.
Click Install Now.
When prompted, click Activate.
Step 3: Clear the WP Rocket cache
After activating the plugin, go to Settings, then WP Rocket.
Click Clear Cache, or use the WP Rocket option in the WordPress admin bar.
This ensures the reverted Delay JavaScript Execution script is applied to cached pages.
Step 4: Verify the fix
Visit a cached page on your site.
Do not use nocache URLs or logged-in previews.
Click Accept, Reject, and Preferences on the consent banner.
You should see the buttons respond immediately, the consent state update correctly, and no frozen or unresponsive behavior.
Additional Notes
This issue is specific to WP Rocket’s Delay JavaScript Execution functionality.
Captain Compliance scripts themselves do not require modification.
Once WP Rocket releases an official fix, this helper plugin may no longer be necessary.
