Updating WordPress is a fundamental part of keeping your site safe. It can be difficult if you don’t have a lot of experience with it – that’s why we are going to show you how auto-updates work, how to configure them and the different options which WordPress provides for this.
WordPress has split the core updates into three sections.
- Core Development updates: “Bleeding edge”
- Minor core updates: Maintenance and security releases
- Major core: Major releases
Your update preference can set by adding the line below to your wp-config.php file:
define( 'WP_AUTO_UPDATE_CORE', UPDATE_OPTION );
UPDATE_OPTION will need updating to one of the following three options:
- true – Development, minor, and major updates are all enabled
- false – Development, minor, and major updates are all disabled
- minor – Minor updates are enabled, development, and major updates are disabled
So here is an example for enabling auto updates on your WordPress core:
define( 'WP_AUTO_UPDATE_CORE', true);
If you wish to disable this feature and apply the updates when your ready you can also add the following line to your wp-config.php file:
define( 'AUTOMATIC_UPDATER_DISABLED', true );
Themes and Plugins
WordPress has also provided the functionality to update themes and plugins. By default WordPress has disabled the automatic update functions for themes and plugins. To enable this you have to add two lines to the functions.php file of the currently active theme. This will be located in the following folder:
After the first <?php you should add the following lines:
add_filter ( 'auto_update_plugin' , '__return_true' ) / / Plugins add_filter ( 'auto_update_theme' , '__return_true' ) / / Themes
However you do need to be aware of the possible pitfalls this can cause, both themes and plugins can cause issues with incompatible versions of WordPress. So if a new security update for WordPress in installed on the same day the latests update for a plugin is install this could possible render your website inaccessible.
Will this work for me?
Some users may have opted to restrict WordPress and if they try to upload content such as a plugin they would be prompted to supply FTP connection details:
If you have these restrictions in place WordPress will be unable to use its new automatic update feature.
Last saved: 2021/11/11 at 14:27 by Jamie