Skip to main content

WEBINARNavigating Consent Mode V2: How Should I Prepare?

|

30 April, 2024

3 pm CET (8 am CT)

Register now

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.

Wp Rocket in WordPress dashboard

Step 2. Click the File Optimization tab, and scroll down to the JavaScript Files section.

File Optimization tab in Wp Rocket WordPress plugin

Step 3: Within the JavaScript Files section, you will encounter options for Minify JavaScript files, Load JavaScript deferred, and Delay JavaScript Execution. Upon enabling each option, a text field labelled “Exclude JavaScript Files” will become visible.

Step 4: In the text field labelled Exclude JavaScript Files, paste client_data/(.*)/script.js for each option or for the option(s) you prefer.

Exclude JavaScript File

This will exclude any JavaScript file from CookieYes from being optimized by the WP Rocket plugin.

Step 4: Click the Update File button to save the changes, 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