Features
How to Exclude CookieYes Script from WP Rocket Plugin
WP Rocket is a caching plugin that helps to speed up your WordPress website.
If you are using CookieYes and WP Rocket together on your WordPress website, you might face an issue with CookieYes not working as intended. WP Rocket’s caching function may interfere with CookieYes’s script, causing the cookie banner to be empty or show errors.
To get the CookieYes script running properly, you need to exclude it from being optimized by WP Rocket. This will allow CookieYes to work correctly while still having the benefits of using WP Rocket.
Steps to exclude CookieYes script from the WP Rocket plugin
Step 1. Log in to your WordPress admin dashboard and navigate to Settings > WP Rocket.
Step 2. Click the File Optimization tab, and scroll down to the JavaScript Files section.
Step 3: In the JavaScript Files section, you’ll find options for Minifying JavaScript files, Loading JavaScript deferred and Delaying JavaScript execution. When any of these options are enabled, a text field labelled Exclude JavaScript Files will appear.
Step 4: In the text field labelled Exclude JavaScript Files, add the following exclusions:
- To exclude scripts from CookieYes, enter
client_data/(.*)/script.js
. This excludes any JavaScript file from CookieYes from being optimized by the WP Rocket plugin. - To exclude scripts related to GCM (if the option for Google Consent Mode is enabled in the CookieYes plugin),enter
cookie-law-info
and
._ckyGcm
Ensure that you add these scripts in all relevant fields where exclusions are required.
This will exclude any JavaScript file from CookieYes from being optimized by the WP Rocket plugin.
Step 4: Click the SAVE CHANGES button to save the changes made, and then clear the cache of your website to reflect the update. After completing these steps, the cookie banner should no longer be empty or show errors.
If you are still facing any issues or have any questions, please contact support.