Hello,
on my GTmetrix my webiste has got 0 in Defer parsing of JavaScript.
So, I used this code:
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 );
but nothing happened.
How can I improve the grade?
Hey Gian Maria,
Did you try using a minify plugin? https://wordpress.org/plugins/bwp-minify/
Please link to your results if you should need any further help.
Best regards,
Rikard
I’m doing it but it doesn’t help.
Hi,
image you’ve provided does not display, please imgur.com or dropbox instead. Does it work for you with a default WP theme? Anyway, seems that you need to search for another plugin with such functions. Hope you’ll find one which is compatible.
Best regards,
Andy