如何解决WordPress打开后台很慢的方法

Wordprss后台加载了google字体,导致后台速度变慢,所以西瓜君今天总结一下解决wordpres打开后台很慢的方法。一共有两种解决方法 一种是用代码,一种是用插件,尽量使用代码来解决,少装插件,要不然会影响访问速度的。

代码解决方法

把下面的代码放进你主题的functions.php文件中。

// 后台禁用Google Open Sans字体,加速网站
add_filter('gettext_with_context', 'disable_open_sans', 888, 4 );
function disable_open_sans( $translations, $text, $context, $domain )
{
if ( 'Open Sans font: on or off' == $context && 'on' == $text ) {
$translations = 'off';
}
return $translations;
}

插件解决方法

在wordpress后台插件页面,点击安装插件,搜索Disable Google Fonts这个插件,安装并启用即可。

插件的方法是最简便的,具体怎么选择看大家喜好了。

发表评论