How Can I Prevent WordPress from Auto-Updating?

How Can I Prevent WordPress from Auto-Updating?

If you are a webmaster managing multiple WordPress websites, you may have noticed the CMS platform auto-updating recently. While in most cases the update is harmless, there is always the chance that it negatively affects a website. In the most severe cases, WordPress updates can prevent a website from loading at all. Fortunately, there is a solution for those looking to prevent automatic updates.

The easiest way is to insert the following string of code into your wp-config.php file:

define( 'WP_AUTO_UPDATE_CORE', false );

This code will effectively tell WordPress not to update the website on its own the next time an update is available. Of course, when dealing with your wp-config.php file, you want to be extremely careful. Wp-config contains important information regarding your website, including relevant database details.

The same method can be used to prevent plugins from auto-updating. However, this time, you’ll want to navigate to your functions.php file to put this code in:

add_filter( 'auto_update_plugin''__return_false' );

Finally, WordPress admins are also able to prevent their themes from updating by adding this code to functions.php:

add_filter( 'auto_update_theme''__return_false' );

It’s a best practice to put these codes at the end of the files you are putting them in, or far away from code that serves other functions.

Once you have successfully inserted the relevant code to prevent your website, plugins, or theme from updating, you should be sure to take a few additional precautionary actions:

  • Make a copy of your website in FTP
  • Export all posts, pages, comments, menus and users by navigating to Tools>Export
  • Most importantly, backup your database. Steps may vary by hosting provider.
admin
No Comments

Sorry, the comment form is closed at this time.