TL;DR
NitroPack’s Delayed Scripts feature allows you to postpone the execution of specific scripts until after the page has fully loaded. This reduces initial load times and keeps your page fast and responsive without breaking functionality.
Not every script on your website needs to load immediately.
In fact, many (e.g., chat widgets, heatmaps, or tracking tools) can safely wait. But browsers don’t know that, so they load everything as soon as possible, often at the expense of speed and usability.
NitroPack’s Delayed Scripts solves this by letting you delay the execution of non-critical scripts until the page is fully loaded and stable.
The result?
A faster WordPress site with a smoother experience without giving up the tools you rely on. Let’s see how.
How Scripts Affect Performance
JavaScript powers many of your site’s most useful features, but loading too many scripts too early can create performance bottlenecks.
When the browser encounters a script, it often pauses HTML parsing to download, process, and run it. This blocks the main thread, the part of the browser responsible for displaying content and responding to input.
And since the main thread can only do one thing at a time, early script execution slows everything else down.

This can result in:
- Delayed content rendering, affecting First Contentful Paint (FCP)
- Late-loading hero sections, hurting Largest Contentful Paint (LCP)
- Unresponsive buttons or menus, which increase Interaction to Next Paint (INP)
- Heavier load on mobile, where hardware limitations make delays more obvious

Test NitroPack yourself
Why Delay Scripts?
Delaying scripts is about load prioritization: showing content first, running extras later.

Many scripts, like chat tools, popups, and analytics, aren’t essential during the first few seconds of a visit. Deferring them frees up the browser to render and respond faster, naturally leading to:
- Faster interactivity – The main thread isn’t blocked by low-priority code
- Cleaner visual load – Fewer layout shifts or flashes of unstyled content
- Better Core Web Vitals – Especially for LCP and INP
- No loss of functionality – Scripts still run, just at a better time
For example, a heatmap or social sharing widget doesn’t need to load before your headline or CTA. Delaying it makes your site feel instantly faster while keeping everything you need.
NitroPack’s Delayed Scripts Explained
With Delayed Scripts, NitroPack lets you delay the execution of specific JavaScript files until approximately 6500ms after the page finishes loading.
You can delay:
- External scripts (e.g., https://cdn.chattool.com/widget.js)
- Inline scripts (snippets included directly in your page’s code)
Here’s how it works:
- You provide either the script’s URL or a unique line of code from the script (if it’s inline)
- NitroPack holds off executing that script until after the critical loading window has passed
- You can also use a wildcard (*) to match dynamic script variations or multiple similar resources
Important
The script still runs and works, just later, when it’s less likely to interfere with performance.
How to Delay Scripts in NitroPack
Here’s how to start using the feature:
- Log into your NitroPack dashboard
- Go to Cache Settings >> JavaScript
- Enable the Delayed Scripts feature
- In the input field, do one of the following:
- For external scripts: Enter the full or partial script URL
- Example: https://cdn.analytics.com/tracker.js
- Example: https://cdn.analytics.com/tracker.js
- For inline scripts: Enter a unique line of code from the script (without the
<script>tag)
- Example:
window.intercomSettingsordocument.querySelector(".cta-button")
- Example:
- For external scripts: Enter the full or partial script URL
- Use wildcards (*) to match patterns or dynamic elements
- Example: https://cdn.chatapp.com/widget*.js
- Example:
document*cta-button
- Example: https://cdn.chatapp.com/widget*.js
- Click save, and purge your cache to apply changes

Pro Tip
Use Test Mode to preview the impact before going live.
FAQs
How long is the delay?
Approximately 6500ms (6.5 seconds) after the page has fully loaded. This allows the page to render and become interactive first.
Will the script still work?
Yes. NitroPack simply delays execution—it does not disable or remove the script.
Can I delay multiple scripts?
Absolutely. You can enter multiple entries—one per line—in the settings field.
What if the script is needed early for UX or layout?
If a script is critical to layout, animations, or user input, don’t delay it. This feature is best used for non-essential third-party tools.
Does this affect Core Web Vitals?
Yes—in a good way. By reducing early main thread blocking, Delayed Scripts can improve INP, LCP, and your initial load time.

