Completely turn off automatic WordPress updates and background update checks

Sometimes, when we configure wordpress and change the theme, we don't want to update wordpress, but wordpress often pushes automatic updates, so how do you turn off automatic updates for wordpress?
Methods: add the following code to the current theme functions.php file to completely turn off automatic WordPress update and background update checking, so that when the update, you will have to manually update, such as using SSH to install, upgrade and migrate WordPress blogs.

Add_filter (' automatic_updater_disabled ', '__return_true'); // turn off auto update completely

Remove_action (' init ', 'wp_schedule_update_checks'); // turn off the update check timing job
Wp_clear_scheduled_hook (' wp_version_check '); // remove an existing version check timing job
Wp_clear_scheduled_hook (' wp_update_plugins'); // remove an existing plugin update timer job
Wp_clear_scheduled_hook (' wp_update_themes'); // remove an existing topic update timer job
Wp_clear_scheduled_hook (' wp_maybe_auto_update '); // remove the existing automatic update timing job

Remove_action (' admin_init ', '_maybe_update_core'); // remove background kernel update checks

Remove_action (' load - plugins. PHP ', 'wp_update_plugins'); // remove background plugin update check
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 background theme update check
Remove_action (' load - update. PHP ', 'wp_update_themes');
Remove_action (' load - update - core. PHP ', 'wp_update_themes');
Remove_action (' admin_init ', '_maybe_update_themes');

Leave a Reply

Your email address will not be published. Required fields are marked *