Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Please create a plugin to Async Javascript or Defer Javascript which are render blocking

0 votes
59 views
asked Dec 1 in Plugins by MKDan
Please create a plugin to Async Javascript or Defer Javascript which are render blocking

1 Answer

+1 vote
answered Dec 1 by Scott
This is not really possible to do. Several of the JS files depend on jQuery so they cannot be loaded async.

Defer would be possible if the JS files included in Q2A were the only ones. But plugins can add their own JS and if they don’t use defer, it will break. Adding inline JS also cannot be deferred.
commented Dec 1 by MKDan
I wonder how such plugins exist for WordPress. There is a plugin called Autoptimize for WordPress which not only minifies all Javascript and CSS. But it also combines them into one. It preloads the critical path CSS. Defers the JS. It has the option to exclude the Javascript and CSS files. There are also separate plugins for Async javascript and defer Javascript.
...