怎么关闭 WordPress 网站后台更新提示?

最近,三零软件发现WordPress和一些插件的更新频率有点高,基本上每隔几天进入WordPress后台都会收到更新提示,那么如何关闭WordPress后台更新提示呢?我们研究后发现是有办法关闭WordPress后台更新提示的,现在就将这篇WP后台更新提示关闭教程分享给大家。

  WP后台更新提示关闭教程

第一种方法是我们可以在WordPress站点根目录中的wp-config.php中加入下列代码来关闭WordPress后台更新提示:

/** 关闭 WordPress 后台更新提示 */
define('AUTOMATIC_UPDATER_DISABLED',true);

第二种方法是将下列代码复制进当前主题的 functions.php 中,大家可以将代码添加在文件的末尾:

//关闭 WordPress 后台更新提示
add_filter('pre_site_transient_update_core',    create_function('$a', "return null;")); // 关闭核心提示
add_filter('pre_site_transient_update_plugins', create_function('$a', "return null;")); // 关闭插件提示
add_filter('pre_site_transient_update_themes',  create_function('$a', "return null;")); // 关闭主题提示
remove_action('admin_init', '_maybe_update_plugins'); // 禁止 WordPress 更新插件
remove_action('admin_init', '_maybe_update_core');    // 禁止 WordPress 检查更新
remove_action('admin_init', '_maybe_update_themes');  // 禁止 WordPress 更新主题

上面这两种方法都是WP后台更新提示关闭教程,大家记得在修改好wp-config.php或者functions.php后,要将新的文件上传至服务器,这样就可以关闭WordPress后台更新提示了,希望上面这两个如何关闭WordPress后台更新提示的方法小伙伴们都能学得会。

请登录后发表评论

    没有回复内容