一、linux插件设置
以宝塔面板为例
在软件商店下载Redis和PHP

在PHP设置里选择安装扩展,下载opcache

二、WP后台内的设置
1.打开网站的后台找到,外观选项。选择主题文件编辑器,之后选择右面的functions.php。在最下面添加上以下代码:
//关闭谷歌字体
function xintheme_remove_gutenberg_styles($translation, $text, $context, $domain)
{
if ($context != 'Google Font Name and Variants' || $text != 'Noto Serif:400,400i,700,700i') {
return $translation;
}
return 'off';
}
//彻底关闭自动更新
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');

2. 下载Redis Object Cache和超级缓存插件
在页面左侧选择插件,并点击安装新插件,搜索Redis Object Cache和wp super cache并下载


打开wp super cache设置,启用缓存功能

点击高级,按下面进行配置



之后点击下面的更新
选择预缓存,进行以下配置

之后返回打开Redis Object Cache设置,刷新缓存

Comments 3 条评论
你是我一生只会遇见一次的惊喜…
你是我一生只会遇见一次的惊喜.