How to solve ‘Eliminate render-blocking JavaScript and CSS in above-the-fold’ content for multiple files?

put this code at the end of functions.php

add_action('customize_register', 'customizer');
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 );

Leave a Comment