Load JavaScript deferred

This option addresses the PageSpeed recommendation:

“Eliminate render-blocking resources”

It is preferable for performance that JavaScript files are either loaded in the footer of your site, or deferred so that they don’t block the downloading of other assets on your site, thereby slowing it down. 

By enabling Load JavaScript deferred, all the JavaScript files on your page, including those minified by WP Rocket, will be loaded with the defer attribute:

If you have any issues on your site after activating this option, you may need to activate Safe Mode, which excludes jQuery from being deferred, for compatibility reasons:

Depending on your site, you may also need to exclude some more files from being deferred:  
Exclude files from Defer JS

Note that Google does not take into consideration that sometimes it’s not possible to defer all JavaScript—at least not without breaking your site. Any files you exclude from deferring will cause PageSpeed to complain, however those notices are “false positives”. If your site requires render-blocking jQuery to function correctly, disabling Safe Mode may make the PageSpeed notice disappear, but it will break functionality on your site.

Files that will not have defer applied

The defer attribute will not be applied to elements that already have either of the following attributes:

  • async
  • data-cfasync="false"
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.