近期发觉登陆Wordpress后台管理出现异常迟缓,常常卡在fonts.googleapis.com,这也是因为WordPress后台管理外部链接载入了Google 字体样式(编码部位在wordpresswp-includesscript-loader.php第580行),而谷歌服务器我们都知道的因素中国浏览 艰难,严重影响页面加载速率。
解决方案:
将下边编码加上到主题风格functions.php文件中:
- function coolwp_remove_open_sans_from_wp_core() {
- wp_deregister_style( ‘open-sans’ );
- wp_register_style( ‘open-sans’, false );
- wp_enqueue_style(‘open-sans’,”);
- }
- add_action( ‘init’, ‘coolwp_remove_open_sans_from_wp_core’ );