rocketlazyloadscript: What WP Rocket's Delay JavaScript Does
Short answer rocketlazyloadscript is a fake script type that the WP Rocket plugin writes onto your site's scripts when Delay JavaScript execution is on. Browsers skip scripts with an unknown type, so nothing runs until a visitor moves the mouse, scrolls, taps or presses a key. Pages draw faster, but menus, forms, chat and tracking can wait or break.
Want help applying this to your business? Talk it through on a free 30-minute call.
Book a callWhat does rocketlazyloadscript mean?
It means WP Rocket, a paid WordPress speed plugin, is holding a script back. With its Delay JavaScript execution setting on, WP Rocket rewrites every script in the page's HTML before it reaches the visitor. WP Rocket's own documentation explains the trick:
"On all JavaScript, either with a src attribute or not, a type="text/rocketlazyloadscript" attribute will be added. This fake type value prevents the script from being executed by the browser." (WP Rocket Knowledge Base: Delay JavaScript execution)
When a visitor first moves the mouse, scrolls, taps, clicks or presses a key, WP Rocket's small loader swaps the real type back and the browser runs the scripts, in their original order. Until then, the page shows its text and images but none of the code behind them.
Other tags you may see next to it, all from the same feature:
| In the page code | What it holds |
|---|---|
| type="text/rocketlazyloadscript" | The fake type that stops the script |
| data-rocket-src | The script's real file address, parked until release |
| data-rocket-type | The script's original type, if it had one |
| data-rocket-status | "executed" if the script ran after the delay, "failed" if it didn't |
| src="data:text/javascript;base64,..." | An inline script packed into one line, in Chrome and Safari |
Older versions wrote type="rocketlazyloadscript" without the "text/" part. That failed the W3C markup validator, so WP Rocket's developers changed it (GitHub issue 6844, closed February 2026). Either form means the same thing.
Why does WP Rocket delay JavaScript?
Speed scores. JavaScript (the code that runs menus, sliders, chat bubbles and tracking tags) makes the browser stop and work before it can show the page. WP Rocket says delaying it can improve PageSpeed items such as Total Blocking Time, First Contentful Paint (when the first text or image appears) and "Reduce unused JavaScript." Whether faster scores move your Google ranking is a separate question, answered in our Core Web Vitals guide.
The feature only works on cached pages. Turning it on also switches off WP Rocket's "Combine JavaScript files" setting, so scripts keep their order. Scripts added after the page loads, or pulled in by another script, can't be delayed.
When does it break a page?
Anything a visitor expects to work before touching the page. WP Rocket's troubleshooting guide names the usual suspects:
- A loading spinner that never stops. Theme "preloaders" hide the page until scripts finish, so the spinner keeps going until someone moves the mouse.
- Missing images. A theme's or plugin's own image lazy loading may show nothing until a visitor interacts.
- Dead menus, sliders and filters. The console shows errors such as "Uncaught ReferenceError: ... is not defined" when one script needs another that is still held back.
- Lost tracking. WP Rocket says Google Analytics and Google Ads tracking problems can come from this setting, and offers one-click boxes to exclude Google Analytics and Google Tag Manager. If you count calls and form fills as key events, check them after any change (GA4 key events guide).
- Slow first click. WP Rocket admits the feature "could potentially have a negative effect on the INP" (Interaction to Next Paint, Google's measure of how fast a page reacts to a tap). All held scripts start at once on that first tap.
- Strict security headers. A Content Security Policy that blocks data: scripts stops the packed inline scripts from loading.
Can Google see content behind delayed scripts?
Assume not. Google's crawler doesn't scroll or click:
"Google Search does not interact with your page." (Google Search Central: Fix lazy-loaded website content)
Plain page text in the HTML is fine. But if your reviews, prices or service list only appear after a held-back script runs, Google may never see them. Check what Google renders with the URL Inspection live test in Search Console (Search Console guide).
How do I stop WP Rocket delaying a script?
Exclude only the script that breaks, not everything. WP Rocket offers four ways; start at the top:
- One-click exclusions. Under Delay JavaScript execution, tick the box for the plugin, theme or service (for example Google Tag Manager).
- Excluded JavaScript Files box. Paste part of the file path or a unique word from the script, such as gravityforms/js/gravityforms.min.js. Leave off the version number so the rule survives updates.
- The nowprocket keyword. A developer adds nowprocket or data-nowprocket to the script tag, or writes a // nowprocket comment inside the script. WP Rocket skips any script whose name, attributes or content contain the word.
- Safe Mode. Excludes nearly all scripts. WP Rocket calls it a last resort, because the speed gain mostly disappears.
To find the culprit, open the page with ?nowprocket added to the address. That shows it without WP Rocket's changes. If the problem is gone there, compare the console errors in both tabs.
Example
Plumber's mobile menu won't open
A plumbing company's site scores 95 on mobile, but the menu icon does nothing on the first tap. The theme's menu script is delayed. Adding that one theme file to the exclusion box fixes the menu; the score drops a few points.
Bookings vanished from GA4
A salon turns on Delay JavaScript and its GA4 bookings fall from 40 to 25 a month with no change in calls. The Google tag is now held back with everything else. Ticking the Google Tag Manager box restores tracking.
FAQ
Is rocketlazyloadscript a virus or malware?
No. It is WP Rocket's own marker, added by the plugin on your server when Delay JavaScript execution is on.
Should I turn Delay JavaScript execution off?
Usually not. Exclude the scripts that break and keep the rest delayed. Turn it off only if exclusions don't fix the problem.
Why do I see ?nowprocket=1 in my analytics?
WP Rocket sends Internet Explorer 11 visitors to an unoptimized copy of the page with that tag added. It is harmless.
Does rocketlazyloadscript affect my Google ranking?
Not directly. The tag only changes when scripts run. It matters if delayed scripts hide content from Google or the page gets slow to react to taps.
Different for you?
- Your site isn't on WordPress: this tag doesn't apply. See the platform guide.
- You want to know if speed is worth the trouble: Core Web Vitals and ranking.
- Calls and forms stopped showing in reports: GA4 key events.
- You'd rather someone else tune and test the site: Website agent.