• Hi all,
    If like myself you have chosen this plugin because WP Rocket recommend it, only to find it doesn’t actually work, then read on.
    As you have probably found, no Cookie law plugins work with WP Rocket. What WP Rocket and the nice people hu-manity.co neglect tell you is how to make it work.

    The conflict is really simple. If you are using the WP Rocket’s ‘Remove Unused CSS’ function, it breaks the Cookie Notice. So you have to exclude it. Again, no one will tell you how, so here it is.

    Pop this url into the exclusion field in WP Rocket, changing ‘yourwebsite’ to your website;
    https://yourwebsite/wp-content/plugins/cookie-notice/css/front.min.css?

    Now it will work!

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • I put the link in the CDN section under Exclude files from CDN and no joy.

    Can you specify where exactly you are putting this to get it to work?

    Thanks.

    Think I figured it out…

    Originally I had the On Click and On Scroll turned on. Now when I use a different device, it appears to be working correctly.

    The solution from @troyw2015 is a little too specific base on their settings. To avoid any conflict add the next IDs to the field at Advanced Rules > Never Cache Cookies. In this case you avoid all conflicts (CSS and JS):

    cookie-notice-front-css
    cookie-notice-front-js-extra
    cookie-notice-front-js

    Thank you for sharing your experience and solving the conflict between the Cookie Notice plugin and WP Rocket’s ‘Remove Unused CSS’ function. It’s helpful to know that adding the exclusion URL in WP Rocket can resolve the issue. Your post will undoubtedly assist others who may encounter the same problem. We appreciate your contribution to the community!

    The same error I was facing on https://textgoo.com and here’s the code which would help you

    add_filter(‘rocket_cache_reject_uri’, ‘custom_disable_rocket_cache_migration’, 10, 1);
    function custom_disable_rocket_cache_migration($reject) {
    if (defined(‘WP_CLI’) && WP_CLI && isset($_SERVER[‘REQUEST_URI’]) && strpos($_SERVER[‘REQUEST_URI’], ‘/wp-admin/admin-ajax.php’) !== false) {
    $reject = true;
    }
    return $reject;
    }

    • This reply was modified 1 year, 5 months ago by layladecorly.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WP Rocket Caching Conflict’ is closed to new replies.