WordPress建站教程:关闭自动更新功能

前端之家收集整理的这篇文章主要介绍了WordPress建站教程:关闭自动更新功能前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

使用wordpress建站完成以后,打开后台经常会提示插件wordpress版本需要更新,甚至会自定更新。wordpress自3.7版本以后推出了后台自动更新,定期更新wordpress的核心、主题插件,来提高网站的安全性。有些时候,我们对wordpress或者插件文件进行了一些修改,我们不希望自动更新,而且自动更新会占用服务器的资源。下面我们就介绍一下wordpress关闭自动更新功能方法

1. 关闭后台更新提示

切换到主题目录,打开functions.PHP文件,加入以下代码

Crayon-5c891d0a30f36523478798" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">functions.PHP
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891d0a30f36523478798-1">1
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d0a30f36523478798-2">2
Crayon-num" data-line="Crayon-5c891d0a30f36523478798-3">3
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d0a30f36523478798-4">4
Crayon-num" data-line="Crayon-5c891d0a30f36523478798-5">5
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d0a30f36523478798-6">6
Crayon-num" data-line="Crayon-5c891d0a30f36523478798-7">7
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891d0a30f36523478798-1">Crayon-c">//移除更新提示
Crayon-line Crayon-striped-line" id="Crayon-5c891d0a30f36523478798-2">Crayon-t">functionCrayon-h"> Crayon-e">remove_core_updatesCrayon-sy">(Crayon-sy">)Crayon-sy">{
Crayon-line" id="Crayon-5c891d0a30f36523478798-3">Crayon-h"> Crayon-m">globalCrayon-h"> Crayon-sy">$Crayon-v">wp_versionCrayon-sy">;Crayon-st">returnCrayon-sy">(Crayon-t">objectCrayon-sy">)Crayon-h"> Crayon-t">arrayCrayon-sy">(Crayon-s">'last_checked'Crayon-o">=Crayon-h"> Crayon-e">timeCrayon-sy">(Crayon-sy">)Crayon-sy">,Crayon-s">'version_checked'Crayon-o">=Crayon-h"> Crayon-sy">$Crayon-v">wp_versionCrayon-sy">,Crayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d0a30f36523478798-4">Crayon-sy">}
Crayon-line" id="Crayon-5c891d0a30f36523478798-5">Crayon-e">add_filterCrayon-sy">(Crayon-s">'pre_site_transient_update_core'Crayon-sy">,Crayon-s">'remove_core_updates'Crayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d0a30f36523478798-6">Crayon-e">add_filterCrayon-sy">(Crayon-s">'pre_site_transient_update_plugins'Crayon-sy">,Crayon-s">'remove_core_updates'Crayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891d0a30f36523478798-7">Crayon-e">add_filterCrayon-sy">(Crayon-s">'pre_site_transient_update_themes'Crayon-sy">,Crayon-s">'remove_core_updates'Crayon-sy">)Crayon-sy">;

2. 关闭自动更新功能

切换到网站根目录,打开config.PHP文件,加入以下代码

Crayon-5c891d0a30f3f574377447" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">wp-config.php
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891d0a30f3f574377447-1">1
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891d0a30f3f574377447-1">Crayon-e">defineCrayon-sy">(Crayon-h"> Crayon-s">'AUTOMATIC_UPDATER_DISABLED'Crayon-sy">,Crayon-h"> Crayon-t">trueCrayon-h"> Crayon-sy">)Crayon-sy">;

猜你在找的wordpress相关文章