移除WordPress后台Google相关API

移除WordPress后台Google相关API | JUST FOR FUN
最近常常潜水的wordpress群里来了许多新人,于是乎有一个问题常常被问到 -“为什么我的wp辣么卡”。
通常情况下,我都是一句“安个插件去除”了事,今天突然想记录一下(其实没啥好水的)
1.插件大法好(wp后台搜索安装)。
去除Google字体:Disable Google fonts
去除Google地图:Disable Google Maps;
google字体替换、头像链接替换:wp-plus(现用)、super-plus
2.代码版
移除 Google font 链接

function 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', 'remove_open_sans_from_wp_core' );

替换为360公共库(也可改为极客族公共库或者moenetwork库)

function dmeng_google_font_cdn_replace($html){
$html = str_replace(array('//ajax.lug.ustc.edu.cn','//fonts.lug.ustc.edu.cn'), array('//ajax.useso.com','//fonts.useso.com'), $html);
return $html;
}

 

WP技巧

去除WordPress分类目录链接中的Category类别

2016-7-13 23:53:33

WP技巧代码·功能

DirectAdmin(DA)面板开启网页GZIP压缩

2016-7-14 11:07:51

个人中心
今日签到
有新私信 私信列表
搜索