我有一个网站在Google页面速度洞察中得分很高,但它显示了一个性能问题,指出这个文件需要“删除未使用的JavaScript”:
https://www.gstatic.com/recaptcha/releases/2diXFiiA9NsPIBTU15LG6xPf/recaptcha__en.js
然而,我已经尝试删除我的Invisible Captcha插件,并且还在functions.php中添加了这行代码:add_action('wp_print_scripts', function () {
if ( is_home() ){
wp_dequeue_script( 'google-recaptcha' );
wp_dequeue_script( 'google-invisible-recaptcha' );
}
});
但我仍然收到错误提示。有什么办法可以让这个脚本不加载在我的主页上吗?我的网站正在使用最新版本的WordPress。