Title: Problem with inline JS // GDPR Plugin
Last modified: June 3, 2021

---

# Problem with inline JS // GDPR Plugin

 *  Resolved [holgee](https://wordpress.org/support/users/holgee/)
 * (@holgee)
 * [5 years ago](https://wordpress.org/support/topic/problem-with-inline-js-gdpr-plugin/)
 * Hello,
 * I have a problem with a GDPR Plugin (Cookie Notice & Compliance for GDPR / CCPA)
   as the cookie banner is loaded partly only on some pages. The plugin places an
   inline JS on every page. I have already turned off all CSS and JS optimization
   settings in the LightSpeed Plugin Tool and of course cleared all caches after
   that. But nevertheless, after a few days, the cookie banner is only shown on 
   some pages. I have also tried to set the following java script exclude in the
   LightSpeed Settings (Page Optimization => Tuning)
 *     ```
       cookie-notice-front-js-extra
       ;
       ,
       =
       ```
   
 * But the error remains. Only when the Light Speed Cache is turned off completely,
   the mentioned problem doesn´t occur.
 * I would be very happy, if there is a solution or a kind of help regarding this
   issue, as I really would like to keep LS turned on.
 * If there is something I could provide for further assistance, please let me know.
 * Many thanks in advance for your help.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fproblem-with-inline-js-gdpr-plugin%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/problem-with-inline-js-gdpr-plugin/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/problem-with-inline-js-gdpr-plugin/page/2/?output_format=md)

 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [5 years ago](https://wordpress.org/support/topic/problem-with-inline-js-gdpr-plugin/#post-14469149)
 * please try add
 *     ```
       <IfModule LiteSpeed>
       RewriteEngine On
       RewriteRule .* - [E=Cache-Vary:cookie_notice_accepted]
       </IfModule>
       ```
   
 * at top of your .htaccess, purge all
 *  Thread Starter [holgee](https://wordpress.org/support/users/holgee/)
 * (@holgee)
 * [5 years ago](https://wordpress.org/support/topic/problem-with-inline-js-gdpr-plugin/#post-14470870)
 * Hi [@qtwrk](https://wordpress.org/support/users/qtwrk/)
    Hi [@tenkstars](https://wordpress.org/support/users/tenkstars/)
 * many thanks for your replies and your help!
    I´ve added the mentioned Rewrite
   Rule in the .htaccess file, re-anabled the cache and all Page Optimization settings
   in the LSCache WP Plugin. The .htaccess file now has the following entries:
 *     ```
       <IfModule LiteSpeed>
       RewriteEngine on
       CacheLookup on
       RewriteRule .* - [E=Cache-Control:no-autoflush]
       RewriteRule .* - [E=Cache-Vary:cookie_notice_accepted]
       RewriteRule \.object-cache\.ini - [F,L]
       [...]
       ```
   
 * As mentioned, the “error” occurs after some days, so I’ll keep watching the site
   and give a corresponding feedback here.
    -  This reply was modified 5 years ago by [holgee](https://wordpress.org/support/users/holgee/).
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [5 years ago](https://wordpress.org/support/topic/problem-with-inline-js-gdpr-plugin/#post-14470897)
 * no , don’t add it within the LSCWP marker , add it at very top of your .htaccess,
   outside of LSCWP marker
 * because if you added inside LSCWP marker, each time you change the setting , 
   it will be overwritten
    -  This reply was modified 5 years ago by [qtwrk](https://wordpress.org/support/users/qtwrk/).
 *  Thread Starter [holgee](https://wordpress.org/support/users/holgee/)
 * (@holgee)
 * [5 years ago](https://wordpress.org/support/topic/problem-with-inline-js-gdpr-plugin/#post-14470906)
 * Hi,
    oh – ok! Many thanks for the detailed info! I´ll put it on the very top 
   instead then.
 * Many thanks for your help! I´ll post a feedback regarding this in the next days…
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [5 years ago](https://wordpress.org/support/topic/problem-with-inline-js-gdpr-plugin/#post-14471224)
 * sure, please keep me posted.
 *  Thread Starter [holgee](https://wordpress.org/support/users/holgee/)
 * (@holgee)
 * [5 years ago](https://wordpress.org/support/topic/problem-with-inline-js-gdpr-plugin/#post-14478939)
 * Hi,
    unfortunately, the problem still exists. I have added the mentioned ReWrite
   Rule to the top of the .htaccess file, but after a few days, the Cookie Banner
   was still not loaded on some pages. I also tried to change the ReWrite Rule to
   the following:
 *     ```
       <IfModule LiteSpeed>
       RewriteEngine On
       RewriteRule .* - [E=Cache-Vary:cookie-notice-front-js]
       </IfModule>
       ```
   
 * as “cookie-notice-front-js” is the ID of the script. But also this had no effect.
   
   Furthermore, I have tried to clear the entire cache via Toolbox => Empty Entire
   Cache. Maybe this will help. As mentioned, the problem occurs oddly enough after
   a few days – so I will keep watching the site but I guess, the problem won´t 
   disappear …
 * I have also send a Report to you – the corresponding Number is BSQWTNKT.
 * Many thanks in advance for your help!
    -  This reply was modified 5 years ago by [holgee](https://wordpress.org/support/users/holgee/).
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [5 years ago](https://wordpress.org/support/topic/problem-with-inline-js-gdpr-plugin/#post-14482063)
 *     ```
       <IfModule LiteSpeed>
       RewriteEngine On
       RewriteRule .* - [E=Cache-Vary:cookie_notice_accepted]
       </IfModule>
       ```
   
 * please try this instead, and make sure you do a purge all after you changed the
   rule
 *  Thread Starter [holgee](https://wordpress.org/support/users/holgee/)
 * (@holgee)
 * [5 years ago](https://wordpress.org/support/topic/problem-with-inline-js-gdpr-plugin/#post-14483609)
 * Hi,
    many thanks for your reply! I have changed the ReWrite Rule back to your
   mentioned one and cleared all caches via Toolbox => Emptiy entire cache. I will
   keep watching the site for a few days and give an update here afterwards.
 *  Thread Starter [holgee](https://wordpress.org/support/users/holgee/)
 * (@holgee)
 * [5 years ago](https://wordpress.org/support/topic/problem-with-inline-js-gdpr-plugin/#post-14493146)
 * Hi,
    many thanks for your help – but unfortunately, the problem still exists.
   I have placed the Rewrite Rule on top of the .htaccess file like this:
 *     ```
       # Exception for LSC
       <IfModule LiteSpeed>
       RewriteEngine On
       RewriteRule .* - [E=Cache-Vary:cookie_notice_accepted]
       </IfModule>
       # BEGIN LSCACHE
       ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
       <IfModule LiteSpeed>
       RewriteEngine on
       CacheLookup on
       RewriteRule .* - [E=Cache-Control:no-autoflush]
       RewriteRule \.object-cache\.ini - [F,L]
   
       ### marker NOCACHE COOKIES start ###
       RewriteCond %{HTTP_COOKIE} cookie_notice_accepted
       RewriteRule .* - [E=Cache-Control:no-cache]
       ### marker NOCACHE COOKIES end ###
   
       ### marker CACHE RESOURCE start ###
       RewriteRule wp-content/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php - [E=cache-control:max-age=3600]
       ### marker CACHE RESOURCE end ###
   
       ### marker FAVICON start ###
       RewriteRule favicon\.ico$ - [E=cache-control:max-age=86400]
       ### marker FAVICON end ###
   
       ### marker DROPQS start ###
       CacheKeyModify -qs:fbclid
       CacheKeyModify -qs:gclid
       CacheKeyModify -qs:utm*
       CacheKeyModify -qs:_ga
       ### marker DROPQS end ###
       </IfModule>
       ```
   
 * Afterwards, all caches has been cleared and additionally the Toolbox => Clear
   entire cache function was used. But, after a short period of time the cookie 
   banner is not loaded on some pages. I have turned of the cache function now and
   sent you a report. The ID is: HYUXACXF
 * If there could be a kind of “workaround” or help, I would be very happy.
 * Many thanks in advance.
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [5 years ago](https://wordpress.org/support/topic/problem-with-inline-js-gdpr-plugin/#post-14496481)
 * is it this one ?
 * [https://wordpress.org/plugins/cookie-notice/](https://wordpress.org/plugins/cookie-notice/)
 *  Thread Starter [holgee](https://wordpress.org/support/users/holgee/)
 * (@holgee)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/problem-with-inline-js-gdpr-plugin/#post-14497261)
 * [@chenhanqiongdemaiya](https://wordpress.org/support/users/chenhanqiongdemaiya/)
   
   Thanks for your reply and suggestion! But the Banner is placed on the Bottom 
   😉
 *  Thread Starter [holgee](https://wordpress.org/support/users/holgee/)
 * (@holgee)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/problem-with-inline-js-gdpr-plugin/#post-14497265)
 * [@qtwrk](https://wordpress.org/support/users/qtwrk/)
    yes that´s the one 😉
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/problem-with-inline-js-gdpr-plugin/#post-14500630)
 * hmmmm , it actually works on my test site
 * do you have a pattern for how it will occur ? only after few days ?
 *  Thread Starter [holgee](https://wordpress.org/support/users/holgee/)
 * (@holgee)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/problem-with-inline-js-gdpr-plugin/page/2/#post-14502082)
 * [@qtwrk](https://wordpress.org/support/users/qtwrk/)
    Big thanks for your kind
   help and support! Unfortunately, there is no direct “pattern” – when the caching
   is activated, the banner is not loaded on some pages – for example the “contact”
   Page, or the “about me” Page. Even when I had cleared all caches, the banner 
   then was loaded on the “contact” and “about me” Page, but not in the “privacy
   policies” Page. But I have re-activated the LS Cache now and I´m pretty sure,
   that the “problem” will occur timely. So I would suggest, that I would then send
   you a corresponding link, where the banner is not loaded. And yes, it only occurs
   after a short time, not directly after activating the LS Cache or clearing the
   entire cache. I have also tried to load the page with different Browsers (all
   Browser Caches was cleared formerly) – but there is no difference regarding the“
   problem”.
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/problem-with-inline-js-gdpr-plugin/page/2/#post-14504813)
 * Hi,
 * please try add this into your theme’s `functions.php`
 * and then purge all , see if it helps
 * `add_filter( 'litespeed_vary_cookies', function( $list ) { $list[] = 'cookie_notice_accepted';
   return $list; } );`
 * if you are testing on your own browser please make sure have cleaned up the browser
   cache
 * and if it doesn’t pop up when/where it supposed to be , please also check in 
   your cookie , looking for the value of `cookie_notice_accepted`
 * Best regards,

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/problem-with-inline-js-gdpr-plugin/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/problem-with-inline-js-gdpr-plugin/page/2/?output_format=md)

The topic ‘Problem with inline JS // GDPR Plugin’ is closed to new replies.

 * ![](https://ps.w.org/litespeed-cache/assets/icon-256x256.png?rev=2554181)
 * [LiteSpeed Cache](https://wordpress.org/plugins/litespeed-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/litespeed-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/litespeed-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/litespeed-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/litespeed-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/litespeed-cache/reviews/)

 * 16 replies
 * 4 participants
 * Last reply from: [holgee](https://wordpress.org/support/users/holgee/)
 * Last activity: [4 years, 12 months ago](https://wordpress.org/support/topic/problem-with-inline-js-gdpr-plugin/page/2/#post-14511309)
 * Status: resolved