Flying Scripts by WP Speed Matters


Download and execute JavaScript on user interaction.

Quick Links

Flying Scripts delay the execution of JavaScript until there is no user activity. You can specify keywords to include JavaScripts to be delayed. There is also a timeout which executes JavaScript when there is no user activity.

Why should I use this plugin?

JavaScript is very resource-heavy. By delaying the execution of non-critical JavaScript (that are not needed for the initial render), you’re prioritizing and giving more resources to critical JavaScript files. This way you will reduce render time, time to interactive, first CPU idle, max Potential input delay etc. This will also reduce initial payload to browsers by reducing the no. of requests.



  1. Visit ‘Plugins > Add New’
  2. Search for ‘Flying Scripts’
  3. Activate Flying Scripts for WordPress from your Plugins page.
  4. Visit Settings -> Flying Scripts to configure


What are the ideal scripts to be included?

Any script that is not crucial for rendering the first view or above fold contents. 3rd party scripts like tracking scripts, chat plugins, etc are ideal.

What should I put in include keywords

Any keyword inside your inline script that uniquely identifies that script. For example “fbevents.js” for Facebook Pixel, “gtag” for Google Tag Manager, “customerchat.js” for Facebook Customer Chat plugin.

How is it different from `defer`

defer tells browser to download the script when found and execute it when HTML parsing is complete. When you include a script in Flying Scripts, those scripts won’t be executed until there is a user interaction.

What is user interaction?

Events from the user like mouse hover, scroll, keyboard input, touch in mobile device, etc.

What is timeout?

Even if there is no user interaction, scripts will be executed after the specified timeout.


October 18, 2020
It blows my mind when I saw my pagespeed went from 53 (mobile) to 99. Then I checked the First Content Paint, Time to interactive, etc, everything went from red/yellow to full green. Loading speed from 3 secs to 1.5. I tested with Gtmetrix as well and is the same result. From yellow to full green 😀 I added Adsense, analytics, wp stats, and even jquery.
July 16, 2020
of the best I could try so far in optimization. I hope it will continue to improve and I can create new plugins of this quality. super recommended
July 9, 2020
A super beautiful, lightweight plugin that can make sure unnecessary garbage scripts that are not needed for your initial page load, you can simply make sure they gets loaded only after some user interaction or x amount of time. A super handy tool to boost the speed of your website that is getting eaten mostly by third-party unnecessary scripts. Truly kudos to the dev for making this plugin and sharing it for free. The best part is, the plugin works perfectly even if you are using Cloudflare Rocket Loader. I just wish there was some similar plugin for CSS files so that we can load some CSS files asynchronously; while only loading the important CSS files that are must needed synchronously.
Read all 17 reviews

Contributors & Developers

“Flying Scripts by WP Speed Matters” is open source software. The following people have contributed to this plugin.




  • Security updates


  • [BUGFIX] Disable for admin interface when using W3 Total Cache


  • [BUGFIX] Support for W3 Total Cache


  • [REMOVED] Unnecessary “scroll” event


  • [UPDATE] Set data-type='lazy' instead of type='lazy'. Removed setting type='text/javascript' via JavaScript


  • [BUGFIX] Remove event listeners after scripts are loaded


  • [UPDATE] Copy updates


  • [UPDATE] Minified JavaScript
  • [UPDATE] Updated copy, FAQ


  • [BUGFIX] Exclude json and other script tags


  • [NEW] Load scripts on user interaction
  • [REMOVED] Load scripts after delay


  • Initial release