I have a site that scores well on Google Page Speed Insights, but it shows a performance issue that says "Remove unused JavaScript" for this file:
https://www.gstatic.com/recaptcha/releases/2diXFiiA9NsPIBTU15LG6xPf/recaptcha__en.js
However, I have tried removing my Invisible Captcha plugin, and also adding this line of code to functions.php:
add_action('wp_print_scripts', function () {
if ( is_home() ){
wp_dequeue_script( 'google-recaptcha' );
wp_dequeue_script( 'google-invisible-recaptcha' );
}
});
But I still get the error. Is there anything I can do to remove this script from loading on my home page? My site is using the latest version of Wordpress.