This is an element of the GTMetrix recommendations that has always been difficult to fix but I found a solution that can help it slightly.


Add this code to the functions.php file (on the next line after the <?php at the top).

function defer_parsing_of_js ( $url ) {
if ( FALSE === strpos( $url, '.js' ) ) return $url;
if ( strpos( $url, 'jquery.js' ) ) return $url;
return "$url' defer ";
}
add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 );