# How to Exclude CookieYes Script from WP Rocket Plugin

> For the complete site index, see [llms.txt](/llms.txt). Every page is also available as Markdown: replace the trailing slash with `.md` (`/pricing/` becomes `/pricing.md`), or send `Accept: text/markdown` to the page URL itself.

WP Rocket plugin on your WordPress website may cause your CookieYes banner to not work as intended. Check this guide to know how to resolve this issue.

---

**Categories:** Integrations Documentation, Features Documentation, WordPress
**Last updated:** October 16, 2024
**Image:** https://assets.cookieyes.com/wp_rocket_logo_1fcf93b5a3.png
**URL:** https://www.cookieyes.com/documentation/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 dahboard WP rocket](https://assets.cookieyes.com/wp_dahboard_WP_rocket_6055625640.png)

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

![javascript file](https://assets.cookieyes.com/javascript_file_e440034a65.png)

**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.

![minify](https://assets.cookieyes.com/minify_5960d3f39a.gif)

**Step 4: **In the text field labelled Exclude JavaScript Files, add the following exclusions:

1. 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.
2. 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.

![scriptt o exclude](https://assets.cookieyes.com/scriptt_o_exclude_f5d133bfdd.gif)

This will exclude any JavaScript file from CookieYes from being optimised by the WP Rocket plugin.
Step 5: 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.


---

## Structured Data

```json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "Article",
      "headline": "How to Exclude CookieYes Script from WP Rocket Plugin",
      "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "https://www.cookieyes.com/documentation/exclude-cookieyes-script-from-wp-rocket-plugin/"
      },
      "url": "https://www.cookieyes.com/documentation/exclude-cookieyes-script-from-wp-rocket-plugin/",
      "publisher": {
        "@type": "Organization",
        "name": "CookieYes",
        "url": "https://www.cookieyes.com",
        "logo": {
          "@type": "ImageObject",
          "url": "https://www.cookieyes.com/cookieyes-logo.png",
          "width": 2048,
          "height": 2048
        }
      },
      "description": "WP Rocket plugin on your WordPress website may cause your CookieYes banner to not work as intended. Check this guide to know how to resolve this issue.",
      "datePublished": "2022-04-04T07:06:32+00:00",
      "dateModified": "2024-10-16T12:00:00+00:00",
      "author": {
        "@type": "Person",
        "name": "CookieYes Doc Team"
      },
      "image": [
        "https://assets.cookieyes.com/wp_rocket_logo_1fcf93b5a3.png"
      ]
    },
    {
      "@type": "BreadcrumbList",
      "@id": "https://www.cookieyes.com/documentation/exclude-cookieyes-script-from-wp-rocket-plugin/#breadcrumb",
      "itemListElement": [
        {
          "@type": "ListItem",
          "position": 1,
          "name": "Home",
          "item": "https://www.cookieyes.com/"
        },
        {
          "@type": "ListItem",
          "position": 2,
          "name": "Documentation",
          "item": "https://www.cookieyes.com/documentation/"
        },
        {
          "@type": "ListItem",
          "position": 3,
          "name": "Features Documentation",
          "item": "https://www.cookieyes.com/category/documentation/features/"
        },
        {
          "@type": "ListItem",
          "position": 4,
          "name": "Integrations Documentation",
          "item": "https://www.cookieyes.com/category/documentation/features/integrations/"
        },
        {
          "@type": "ListItem",
          "position": 5,
          "name": "How to Exclude CookieYes Script from WP Rocket Plugin",
          "item": "https://www.cookieyes.com/documentation/exclude-cookieyes-script-from-wp-rocket-plugin/"
        }
      ]
    },
    {
      "@type": "WebSite",
      "@id": "https://www.cookieyes.com/#website",
      "url": "https://www.cookieyes.com/",
      "name": "CookieYes",
      "description": "CookieYes is a Google-certified consent management platform that helps businesses comply with GDPR, CCPA, and other global privacy laws.",
      "inLanguage": "en-US",
      "publisher": {
        "@id": "https://www.cookieyes.com/#organization"
      },
      "potentialAction": {
        "@type": "SearchAction",
        "target": {
          "@type": "EntryPoint",
          "urlTemplate": "https://www.cookieyes.com/?s={search_term_string}"
        },
        "query-input": {
          "@type": "PropertyValueSpecification",
          "valueRequired": true,
          "valueName": "search_term_string"
        }
      }
    },
    {
      "@type": "Organization",
      "@id": "https://www.cookieyes.com/#organization",
      "name": "CookieYes",
      "url": "https://www.cookieyes.com/",
      "logo": {
        "@type": "ImageObject",
        "@id": "https://www.cookieyes.com/#/schema/logo/image/",
        "inLanguage": "en-US",
        "url": "https://www.cookieyes.com/cookieyes-logo.png",
        "contentUrl": "https://www.cookieyes.com/cookieyes-logo.png",
        "width": 2048,
        "height": 2048,
        "caption": "CookieYes"
      },
      "image": {
        "@id": "https://www.cookieyes.com/#/schema/logo/image/"
      }
    }
  ]
}
```
