Script Not Deferring With Plugin

sharingsunshine used Ask the Experts™
I am working with pagespeed and gtmetrix and they both say I need to defer this script - 

As you can see in the plugin async javascript I have this listed to defer

However, looking at the source at you can see that the script isn't being deferred.  

Here is the gtmetrix readout -

How do I get this script to defer?  Is there another method that is better?

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

pagespeed and gtmetrix are both lying to you.  That script Must load first before any jquery statements are executed.  Deferring it will always cause problems.
Fractional CTO
Distinguished Expert 2018
Okay... +1 for Dave's comment. I was going to be more politically correct because EE internal staff continually rag on me for being blunt.

Never believe what PageSpeed + GtMetrix tell you.

Use instead, as WPT will tell you reasonable things to fix which will actually be beneficial.

For example, you're running WordPress, so if you start mucking around with when JQuery loads you'll likely end up with a serious mess of subtle problems which will be impossible to debug.

Stick with WPT instead.

Suggestion: Work with someone who truly understands WordPress along with the entire LAMP Stack, before you take advice about any odd WordPress or LAMP changes.
David FavorFractional CTO
Distinguished Expert 2018

As Dave Baldwin + I mentioned, the Google PageSpeed tool is one of the few tools Google provides which produces bogus suggestions.

GTMetrix is certainly the worst. PageSpeed is a close second.

WebPageTest provides correct/actionable items to fix... which won't destroy your site function, like PageSpeed or GTMetrix.

A simple example, if you remove file version strings like many tools suggest, your site will develop buggy behavior over long periods of time, because you'll end up with mismatched .js + .css files scattered through visitor's browser caches, which produces an impossible to debug + fix problem.

Stick with WebPageTest. All provided tuning suggestions are correct.


I'll start using webpagetest from now on.  It does give much more detail on how to improve the site.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial