Skip to content

Works with your stack

Cookie consent for WP Rocket

never delayed

← Cookie Rocks for your stack

WP Rocket can hold every script until the visitor moves the mouse or scrolls. Good for speed, bad for consent: a consent script has to run first, before anything else.

By WP Media · wp-rocket.me

Cookie Rocks in the WP Rocket exclusion list

Is this your product? Tell us if anything here is out of date. Write to us

WP Rocket

WordPress plugin

Tested
How
Reproduced in the Cookie Rocks tests
Last test
14 October 2026

What matters for consent with WP Rocket

Delay JavaScript execution

With this option on, scripts wait for a first interaction. A delayed consent script shows the banner late, after the visitor has started reading.

Defer and combine

WP Rocket can also defer and combine scripts. The consent script has to keep its place at the top of the page.

A cache to clear

WP Rocket keeps a copy of each page. A banner change reaches visitors once that copy is cleared.

YouTube preview images

WP Rocket can show a preview image instead of each YouTube video until the click. The image comes from YouTube’s servers: see YouTube.

Preloading

WP Rocket builds cached pages in advance. The page holds no visitor’s choice, so a preloaded page is right for everyone.

Cookie Rocks with WP Rocket

  • Adds the banner’s scripts to its exclusions from delay, combining and minifying.
  • Marks the consent script so it is neither moved nor delayed.
  • Clears its page cache when you change something visitors can see.
  • Holds the scripts it delays until the first interaction, runs them at once after consent, then leaves them to it on the next pages.

All the features

What our tests found on WP Rocket

  • Good to know · WP RocketWhat WP Rocket stores in visitors' browsers when it delays JavaScript

    WP Rocket: rocketCSPIssue (session storage, necessary) after a CSP block.

    NameKept inCategoryWhat it is for
    rocketCSPIssuesessionStorageNecessaryRemembers that the site's security policy blocks delayed scripts

    Read in its code, 4 November 2026, WP Rocket.

    Full detail

    When WP Rocket delays JavaScript, it sets rocketCSPIssue = true in session storage after a Content Security Policy blocks one of its data: scripts, and reads it on the next pages. The Audit 2.9.11 lists it without a category.

  • Good to know · Cookie RocksThe audit names the local fonts setting of your theme

    When the home page loads Google Fonts, the Cookie Rocks 2.9.5 audit names the setting of the active theme or plugin that serves them from the site: Elementor, WP Rocket, Spectra, Kadence Blocks, OMGF, Local Google Fonts, Astra, Kadence, OceanWP or Neve. Otherwise it suggests a plugin such as OMGF. Divi, Bricks, Oxygen and Beaver Builder have no such setting. With Cookie Rocks Pro, it points to « Serve Google Fonts from this site » instead.

    Read in its code, 1 November 2026, Cookie Rocks.

  • Depends on a setting · WP RocketWP Rocket's Combine JavaScript can run a held script before consent

    setting “Combine JavaScript files” · by default: off

    It does not check script types, so a script held by a consent plugin can be pulled into the combined file. Local files with data-no-minify are spared; external ones only via the exclude list.

    Read in its code, 16 October 2026, WP Rocket 3.23.5.1.

    Full detail

    WP Rocket's Combine JavaScript files (usable only when Delay JavaScript execution is off) does not check the type of a script with a src, so a local or external script held as type="text/plain" by a consent plugin can be pulled into the combined file and run before consent. Local files with data-no-minify are spared; external ones only through the exclude list or the rocket_minify_excluded_external_js filter.

  • Set before the choice · WP RocketWP Rocket YouTube preview image loads from i.ytimg.com before the choice

    setting “Replace YouTube iframe with preview image”

    With the preview image option, the image loads from i.ytimg.com when the page shows, and YouTube only on click. Cookie Rocks 2.5.0 holds iframes that WP Rocket lazy loads.

    Read in its code, 16 October 2026, WP Rocket 3.23.5.1.

    Full detail

    WP Rocket's lazy load only rewrites iframes that have a src attribute (data-no-lazy or skip-lazy excludes them). With Replace YouTube iframe with preview image, the preview image loads from i.ytimg.com as soon as the page shows, and YouTube only on click. Cookie Rocks 2.5.0 reads an iframe address waiting in data-lazy-src and holds it.

  • Good to know · WP Rocket, PerfmattersWP Rocket and Perfmatters delayed scripts stay held until consent

    setting “Delay JavaScript execution”

    Tested with an imitated loader, not the paid plugins. Delayed scripts wait for consent, run once the visitor accepts, and never run after Reject all.

    Seen in our tests, 15 October 2026, WP Rocket, Perfmatters.

    Full detail

    Tested with an imitated loader, not with WP Rocket or Perfmatters themselves (paid plugins): scripts delayed as rocketlazyloadscript or pmdelayedscript stay held by Cookie Rocks until consent, even after the first gesture, run as soon as the visitor accepts, and are handed back to the optimiser on the next pages; after Reject all they never run. Cookie Rocks adds its scripts to WP Rocket's delay, defer and combine exclusions and marks its head script nowprocket.

How we test it

Reproduced in our tests

It is sold by its publisher only. Our tests reproduce what it does to the scripts of a page, with its own setting names, and check that the consent script comes through unchanged.

Light as a pebble

11.43 kB once, 1.00 kB per page. Measured, not promised.

lighter than the font on this page*

Every kilobyte costs your visitors time and costs you Core Web Vitals. Cookie Rocks adds 11.43 kB to the first page a visitor opens, then 1.00 kB to each page after that, because its files stay in the browser cache. It calls no outside server and never shifts your layout.

11.43 kB First visit, in total

1.00 kB Each next page

7.74 kB JavaScript, first visit

3.48 kB Stylesheet, first visit

0 Requests to other servers

0 Layout shift caused

* The font on this page is Inter, compressed and cut down to the Latin alphabet. It still weighs 26.23 kB.

Questions

Do I need to add Cookie Rocks to WP Rocket’s exclusions?

No. WP Rocket keeps Cookie Rocks out of Delay JavaScript execution by default, on every site, through its own list of exclusions. Cookie Rocks also adds itself through WP Rocket’s settings: nothing to add by hand.

Will visitors see each other’s choices in a cached page?

No. The choice is read in the browser, after the page arrives, so the cached page is the same for everyone.

And Cloudflare APO or my host’s cache?

They sit in front of WP Rocket and keep their own copy. Clear them by hand after changing what visitors see.

What happens after the 30-day trial?

The banner, your visitors’ choices and your proofs of consent keep working. Without a key, most settings lock, updates and support stop. Take a key at any time and everything opens again.

For WP Rocket sites

Keep WP Rocket, add consent.

never delayed

Every feature of the complete plugin on your WP Rocket site for 30 days, no card.

  • During the trial: everything, including the full settings and the scans
  • After 30 days without a key: the banner, your visitors’ choices and your proofs of consent keep working
  • What waits for a key: most settings, updates and support

How the trial works, in detail

Get your trial key

Your e-mail and your site. Your key arrives as soon as you confirm your e-mail.

One trial per domain. Local and staging sites never use up your key.

We keep your e-mail address to send your key and help you with it, as explained in our privacy policy. No newsletter, nothing else.