By default, wordpress will automatically detect whether there is a new version of the wordpress program, plug-in or theme. It is natural to visit the wordpress website to detect and update the website. It may be due to the current inability to access the wordpress official website, which makes the wordpress background very slow now, and then considering the fact There is no need to automatically detect updates, so I turned off automatic update detection, and the background speed returned to normal.
Turning off wordpress auto-detection updates is as simple as one line of code.
Add the following code to the functions.php file of the current theme and save it
remove_action('admin_init', '_maybe_update_core'); // Disable WordPress auto-detection for updates
If the update of plugins and themes should also be turned off, you can continue to add the following code:
remove_action('admin_init', '_maybe_update_plugins'); // Disable WordPress from updating plugins remove_action('admin_init', '_maybe_update_themes'); // Disable WordPress from updating themes
Attached:Close the latest code provided by programs, plugins, theme updates
add_filter('pre_site_transient_update_core', create_function('$a', "return null;")); // close the core prompt add_filter('pre_site_transient_update_plugins', create_function('$a', "return null;")); // close Plugin prompt add_filter('pre_site_transient_update_themes', create_function('$a', "return null;")); // close theme prompt
In fact, if the website using wordpress is operating normally, if you don’t know much about the wordpress program or the plugin theme used, it is not recommended to update every new version. You can read the official update instructions first, and update if necessary.
In addition, automatic updates will occupy server resources to a certain extent, and the new version may be incompatible with the currently used theme and plugins.Of course, if it's just a website for fun, you don't need to care about it.
Reprint source: www.boke8.net/wordpress-close-auto-update.html