不推荐使用代码禁用,很多都无效
解决办法一:
在functions.php里面添加如下代码:
function hc_cdn_callback($buffer) {
return str_replace(‘googleapis.com’, ‘useso.com’, $buffer);
}
function hc_buffer_start() {
ob_start(“hc_cdn_callback”);
}
function izt_buffer_end() {
ob_end_flush();
}
add_action(‘init’, ‘hc_buffer_start’);
add_action(‘shutdown’, ‘hc_buffer_end’);
解决办法二:
就是把把调用的谷歌的文件链接换成国内的链接。
注:暂时没有找到合适的国内相关服务
解决办法三:
把含有谷歌链接的代码注释掉,这个道理大家应该明白。注释方法如下例子(在代码前面加//就行了):
//wp_register_style(‘underthesea-pacifico’,“$protocol://fonts.googleapis.com/css?family=Pacifico”);
相关插件:Disable Google Fonts
通过wordpress后台安装 ‘Disable Google Fonts’ 这个插件,这是最简单的解决办法,网上大多都是用的这个,不过我测试了一下,没有效果,没起效果的接着往下看!
注意:Disable Google Fonts长时间未更新,不建议使用
相关插件:Disable and Remove Google Fonts

简介:
Improve frontend performance by disabling Google Fonts loaded by themes and plugins.
针对很多主题和插件载入的google字体有效。
测试情况:
安装前,网站前台“查看源代码”,使用Ctrl+F 搜索 fonts.googleapis.com 看看

安装后,再看:
没了。有效
高级分析
通过审查元素找到,拖慢后台加载速度的内容:
比如:
1.https://ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js
2.http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/smoothness/jquery-ui.css
参考阅读: