WordPress 3.7 comes with some cool new features, and one notable feature among them is the new automatic updates. For those who don’t know, automatic updates means that whenever a new minor release such as maintenance or security update is available, WordPress will automatically be updated to the latest version. No manual action needs to be taken by the user for such minor releases. Previously, we’ve written a guide on how to disable automatic updates. But if you really like WordPress auto-updating itself, then the good part is that you can enable it for major releases as well.
Just to clear out doubts, by default, WordPress will auto-update only when there’s a minor or security update is available. For example, a site with WordPress 3.7 will be automatically updated to 3.7.1 as it is a minor release. But a site will not be updated from 3.7.1 to 3.8 as it is a major release. That’s why, in this article, we’ll discuss how to enable WordPress automatic updates for major releases as well.
Normally a major release of WordPress comes with some significant changes and that’s why the core team didn’t enabled automatic updates for major releases. If your site is heavily customized then there are chances that such automatic updates can break your site. Also sometimes plugins and themes are not compatible with the new version, and fixes are provided later on. But if you know that nothing could go wrong after enabling automatic updates, then here’s how to do it.
Turn on automatic updates for major releases
To enable automatic updates for major WordPress releases, simply add the below line to your site’s wp-config.php file. This file can be usually found in the root of your WordPress installation.
define( 'WP_AUTO_UPDATE_CORE', true );
Now this code will enable automatic updates for development, minor and major releases. Normally, you wouldn’t want your installation to be updated with development or nightly updates. To disable such development updates, you need to add the below line to your theme’s functions.php file.
add_filter( 'allow_dev_auto_core_updates', '__return_false' );
This filter will disable automatic updates for development (nightly) updates.
From now on wards, WordPress will automatically update itself to the latest version, be it a major release or a minor release. There’s no need to manually hit the update button.
Note that users running on managed WordPress hosting won’t need to follow this guide as their host will take care of this process. For other users, they’ll enjoy implementing this auto-update method.