Title: Deferring script loading?
Last modified: February 26, 2018

---

# Deferring script loading?

 *  [alzaran](https://wordpress.org/support/users/ajoyce2016/)
 * (@ajoyce2016)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/deferring-script-loading/)
 * Hey, quick question here. As M+M+R is already generating new script files and
   dequeueing the previous files, is it possible to add an option for deferred loading
   of scripts? I’d like to load my concatenated scripts in the footer so that they
   are non-blocking — a little toggle in the settings to enable this would be fantastic!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdeferring-script-loading%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [launchinteractive](https://wordpress.org/support/users/launchinteractive/)
 * (@launchinteractive)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/deferring-script-loading/#post-10017930)
 * G’day,
 * We could add the option to defer all scripts and load in the footer.. but I think
   it might introduce more issues. I’ve seen lots of plugins and themes spit out
   javascript in the middle of the page and expect their enqueued scripts to be 
   loaded already.
 * You could try enqueuing your scripts in the footer (fifth parameter of wp_enqueue_script)
   and then force them all to defer using a filter ([https://matthewhorne.me/defer-async-wordpress-scripts/](https://matthewhorne.me/defer-async-wordpress-scripts/))
   to see if this works for you.. but my guess is most sites will break.
 * Let me know how you go.
 *  [macbookandrew](https://wordpress.org/support/users/macbookandrew/)
 * (@macbookandrew)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/deferring-script-loading/#post-10187240)
 * [@ajoyce2016](https://wordpress.org/support/users/ajoyce2016/),
 * I wrote a little addon plugin last year to do that; you can get it here: [https://andrewrminion.com/2017/05/merge-minify-refresh-force-async-scripts/](https://andrewrminion.com/2017/05/merge-minify-refresh-force-async-scripts/)
 * As the author mentioned, it often does break things because of inlined JS.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Deferring script loading?’ is closed to new replies.

 * ![](https://ps.w.org/merge-minify-refresh/assets/icon.svg?rev=3414776)
 * [Merge + Minify + Refresh](https://wordpress.org/plugins/merge-minify-refresh/)
 * [Support Threads](https://wordpress.org/support/plugin/merge-minify-refresh/)
 * [Active Topics](https://wordpress.org/support/plugin/merge-minify-refresh/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/merge-minify-refresh/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/merge-minify-refresh/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [macbookandrew](https://wordpress.org/support/users/macbookandrew/)
 * Last activity: [8 years, 1 month ago](https://wordpress.org/support/topic/deferring-script-loading/#post-10187240)
 * Status: not resolved