Question
How can I enable auto-updates for WordPress and for all plugins and themes?
I see that from the WordPress dashboard you can enable auto-updates for a specific plugin or theme.
However, how do I force auto-updates for all installed plugins and themes?
Can I also force automatic updates for each new version of WordPress core?
Basically I would like to enable an option to update everything automatically so that I can forget about manual WordPress updates (mainly for security reasons).
Answer
In order to improve the website security and have peace of mind with WordPress updates, there’s a simple way to enable all the automatic updates on WordPress, including the updates for WordPress itself and for all the installed plugins and themes.
You need to edit wp-config.php
in the WordPress root folder. Add these lines of code:
/** WordPress auto-updates */
define('WP_AUTO_UPDATE_CORE', true);
add_filter( 'auto_update_plugin', '__return_true' );
add_filter( 'auto_update_theme', '__return_true' );