我有一个网站在 Google Page Speed Insights 上得分很高,但它显示了一个性能问题,即此文件的“删除未使用的 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。