Skip to main content

Delay All JavaScript

Updated this week

FlyingPress delays non-critical JavaScript from themes, plugins, or inline code to reduce render-blocking and improve Core Web Vitals like LCP and TTI.

How it works

You can choose between two strategies:

  • Load when idle: Scripts run when the browser finishes loading important content and becomes idle

  • Load after interaction: Scripts load only after the user scrolls, clicks, or interacts with the page

All scripts are delayed unless excluded.

Excluding scripts

FlyingPress checks the full <script> tag—src, id, and inline content.
You can exclude a script by entering any partial keyword.

✅ Matching is partial and case-insensitive
Wildcards are not supported (e.g. *slider* won’t work—just use slider)

Examples

✅ External plugin script

<script src="https://example.com/wp-content/plugins/contact-form-7/includes/js/index.js"></script>

Any one of these will exclude it:

contact-form-7
index.js
/wp-content/plugins/

✅ External theme script

<script id="theme-scripts" src="https://example.com/wp-content/themes/astra/js/navigation.js"></script>

Exclude with:

theme-scripts
astra
navigation.js
/wp-content/themes/

✅ Inline script

<script>
window.myChat = { id: 'abc' };
initMyChatWidget();
</script>

Exclude using:

myChat
initMyChatWidget

Tips

  • To exclude all plugin scripts: /wp-content/plugins/

  • To exclude all theme scripts: /wp-content/themes/

  • For inline scripts, use function names or variable names

  • Always test key functionality (menus, sliders, forms) after enabling delay

Did this answer your question?