How To Enable Auto Update for Major and/or Minor Versions In WordPress

Home » Blog » WordPress Development » How To Enable Auto Update for Major and/or Minor Versions In WordPress

If you want to keep your WordPress website up to date in order to get the latest improvements and security fixes, enabling auto updates is the best way to go.

In this article, I’ll share with you an easy way to enable auto updates in your WordPress website.

How To Enable Auto Updates In WordPress

Enabling auto updating in WordPress is really easy. WordPress gives you a really easy way to do it.

All you have to do is add this one line of code to your wp-config.php file:

define( 'WP_AUTO_UPDATE_CORE', true );

This one line of code will enable WordPress to download and install all core updates.

BUT there’s a huge problem with that…

It will also update your WordPress installation to development and nightly builds. These builds are unstable and can be vulnerable to security issues.

To prevent WordPress from installing development and nightly builds, add this line to a custom plugin:

add_filter( 'allow_dev_auto_core_updates', '__return_false' );

To create a custom plugin, use our plugin header generator to generate a plugin file, then add this line of code to it.

How To Enable Auto Update In WordPress For Only The Minor Updates

If you don’t want to take a chance with auto updates but also want to get all the minor security updates, then you’ll need this line of code:

define( 'WP_AUTO_UPDATE_CORE', 'minor');

Place this in your wp-config.php file to enable auto updating to minor updates.

How To Enable Auto Updating Using a WordPress Plugin

If you don’t want to enable auto updates using code, you can use the free Easy Updates Manager plugin. It’s made by the same team behind UpdraftPlus. It makes it easy to manage automatic updates for your website.

Conclusion

If you want to enable auto updates in WordPress, the code above is all you need. It will automatically update your WordPress site to the latest versions of WordPress.

Leave a Reply

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

Register an account to save your snippets or go Pro to get more features.