# How to Exclude CookieYes Script from SG Optimizer 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.

Learn how to exclude the CookieYes script from the SG Optimizer plugin to ensure smooth functionality and proper consent management on your WordPress website.

---

**Categories:** Integrations Documentation, WordPress
**Last updated:** August 29, 2024
**URL:** https://www.cookieyes.com/documentation/exclude-cookieyes-script-from-sg-optimizer-plugin/

---

## Overview

Using CookieYes and SiteGround Optimizer (SG Optimizer) together on your WordPress website might lead to compatibility issues that affect the proper functioning of CookieYes. Specifically, the SG Optimizer’s caching and optimisation function may interact with CookieYes’s script, resulting in unexpected behaviour such as an empty or error-prone cookie banner. To prevent this, exclude the CookieYes script from SG Optimizer’s optimization. By doing so, you ensure the proper functionality of CookieYes while still having the benefits of using SG Optimizer. 

## Steps to exclude CookieYes script from the SiteGround Optimizer plugin

### Step 1

Access the Theme File Editor

Log in to your WordPress admin dashboard and navigate to **Appearance > Theme File Editor**.

![theme](https://assets.cookieyes.com/theme_291a034301.png)

### Step 2

Locate Theme Functions File

In the list of theme files on the right, find and click on **Theme Functions** (functions.php).

![Theme Functions](https://assets.cookieyes.com/Theme_Functions_447944a0f4.png)

### Step 3

Add the Exclusion Code

Scroll down to the code editor section and add the following snippet at the end of the file:

```js
add_filter( 'sgo_javascript_combine_exclude_ids', 'js_sgo_javascript_combine_exclude_ids' );

function js_sgo_javascript_combine_exclude_ids( $exclude_list ) {
    $exclude_list[] = 'cookie-law-info-gcm-var-js';
    $exclude_list[] = 'cookie-law-info-gcm-js';
    $exclude_list[] = 'cookie-law-info-wca';
    $exclude_list[] = 'cookieyes-banner';
    $exclude_list[] = 'cookieyes';
    return $exclude_list;
}
```

![exclusion code 2](https://assets.cookieyes.com/exclusion_code_2_84d4703058.jpg)

### Step 4

Save Your Changes and Clear the Cache

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.

## Conclusion

By excluding the CookieYes script from SG Optimizer’s optimization process, you can resolve compatibility issues while maintaining the benefits of both plugins. This solution ensures that your website’s cookie consent management functions correctly without compromising on performance optimization.


---

## Structured Data

```json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "Article",
      "headline": "How to Exclude CookieYes Script from SG Optimizer Plugin",
      "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "https://www.cookieyes.com/documentation/exclude-cookieyes-script-from-sg-optimizer-plugin/"
      },
      "url": "https://www.cookieyes.com/documentation/exclude-cookieyes-script-from-sg-optimizer-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": "Learn how to exclude the CookieYes script from the SG Optimizer plugin to ensure smooth functionality and proper consent management on your WordPress website.",
      "datePublished": "2023-08-08T06:45:20+00:00",
      "dateModified": "2024-08-29T12:00:00+00:00",
      "author": {
        "@type": "Person",
        "name": "CookieYes Doc Team"
      },
      "image": [
        "https://assets.cookieyes.com/cookieyes.png"
      ]
    },
    {
      "@type": "BreadcrumbList",
      "@id": "https://www.cookieyes.com/documentation/exclude-cookieyes-script-from-sg-optimizer-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 SG Optimizer Plugin",
          "item": "https://www.cookieyes.com/documentation/exclude-cookieyes-script-from-sg-optimizer-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/"
      }
    }
  ]
}
```
