好学习的wade

wordpress网站后台管理比较慢怎么办,加点东西立马搞定

证件照圆型80-80

wordpress网站后台管理比较慢怎么办

我们只需要将下面的代码进行复制,然后粘贴进去,然后保存就可以了。

首先我们先找到外观,主题文件编辑器

wordpress网站后台管理比较慢怎么办,加点东西立马搞定

然后找到functions.php,找不到的话直接ctrl+f查找就可以啦,然后找到底部添加下面这些代码:

wordpress后台管理系统慢怎么办

/*禁用谷歌字体和头像*/
function kratos_get_avatar( $avatar ) {
$avatar = preg_replace( “/http:\/\/(www|\d).gravatar.com/”,”http://cn.gravatar.com”,$avatar );
return $avatar;
}
add_filter( ‘get_avatar’, ‘kratos_get_avatar’ );

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’ );

// 屏蔽谷歌字体
add_filter( ‘gettext_with_context’, ‘wpjam_disable_google_fonts’, 888, 4);
function wpjam_disable_google_fonts($translations, $text, $context, $domain ) {
$google_fonts_contexts = array(‘Open Sans font: on or off’,’Lato font: on or off’,’Source Sans Pro font: on or off’,’Bitter font: on or off’);
if( $text == ‘on’ && in_array($context, $google_fonts_contexts ) ){
$translations = ‘off’;
}

return $translations;
}

//屏幕谷歌的API

// 彻底关闭自动更新
add_filter(‘automatic_updater_disabled’, ‘__return_true’);
// 关闭更新检查定时作业
remove_action(‘init’, ‘wp_schedule_update_checks’);

// 移除已有的版本检查定时作业
wp_clear_scheduled_hook(‘wp_version_check’);

// 移除已有的插件更新定时作业
wp_clear_scheduled_hook(‘wp_update_plugins’);

// 移除已有的主题更新定时作业
wp_clear_scheduled_hook(‘wp_update_themes’);

// 移除已有的自动更新定时作业
wp_clear_scheduled_hook(‘wp_maybe_auto_update’);

// 移除后台内核更新检查
remove_action( ‘admin_init’, ‘_maybe_update_core’ );

// 移除后台插件更新检查
remove_action( ‘load-plugins.php’, ‘wp_update_plugins’ );
remove_action( ‘load-update.php’, ‘wp_update_plugins’ );
remove_action( ‘load-update-core.php’, ‘wp_update_plugins’ );
remove_action( ‘admin_init’, ‘_maybe_update_plugins’ );

// 移除后台主题更新检查
remove_action( ‘load-themes.php’, ‘wp_update_themes’ );
remove_action( ‘load-update.php’, ‘wp_update_themes’ );
remove_action( ‘load-update-core.php’, ‘wp_update_themes’ );
remove_action( ‘admin_init’, ‘_maybe_update_themes’ );

 

// 禁止古腾堡加载 Google 字体
add_action(‘admin_print_styles’, function(){
wp_deregister_style(‘wp-editor-font’);
wp_register_style(‘wp-editor-font’, ”);
});

 

最后一步,代码全部复制完成之后,点击更新文件就可以啦。

wordpress网站后台管理比较慢怎么办,加点东西立马搞定

韦德

哈喽,我是好学习的Wade。

做建站和网络营销5年,运气不错,也算是小有成就,目前吃得好,睡得香,身体嘎嘎棒。

我发现在平时接触的无数家第三方公司中使用套路,我深知建站推广的套路,所以创建了这个网站,把我知道的分享给你。

再读一篇