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.


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.
June 22, 2020
And so am I! I have been refining a clean template of WordPress with the must have plugins and using the Divi builder, I have found that the site performed badly. When I found Gijo's work and tried it, it instantly worked. You have to tweak it, like when you have a Facebook feed widget and you are using the Divi 4, setting the keyword "facebook" will break Divi. So instead, I set "" and GTMetrix was happy so was Divi 🙂 PS: all Gijo's other plugins are also a must have.
May 22, 2020
Great work, really helps to get more speed from site and get more PageSpeed scores! But! It can work only with inline scripts, if i add script with wp_enqueue_script() in functions.php or external script with <sctipt src=""> it can't detect and scripts just don't work
April 20, 2020
if you have any problem with external JavaScript that add enormous network payloads to your initial load time this plugin is for you and it handle like charm. Thank you Gijo for the awesome plugin and for everyone this plugin is much have for speed optimization. Highly recommended
Read all 14 reviews

Contributors & Developers

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




  • [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