I have a custom WordPress theme I've developed and have included the following lines in my wp-config.php in hopes to automate plugin and core updates:
define( 'WP_AUTO_UPDATE_CORE', true );
add_filter( 'auto_update_plugin', '__return_true' );
add_filter( 'auto_update_theme', '__return_true' );
I've let it process for about a week now but the plugins that have available updates aren't updating. Do I need to include anything additional in my theme's functions.php to initiate these automatic updates?
Additionally, does anyone know how quickly these updates take place when a new plugin or core update is released? Or is it essentially instantaneous?
Thanks for your help!
I have a custom WordPress theme I've developed and have included the following lines in my wp-config.php in hopes to automate plugin and core updates:
define( 'WP_AUTO_UPDATE_CORE', true );
add_filter( 'auto_update_plugin', '__return_true' );
add_filter( 'auto_update_theme', '__return_true' );
I've let it process for about a week now but the plugins that have available updates aren't updating. Do I need to include anything additional in my theme's functions.php to initiate these automatic updates?
Additionally, does anyone know how quickly these updates take place when a new plugin or core update is released? Or is it essentially instantaneous?
Thanks for your help!
Share Improve this question asked Jul 10, 2020 at 15:48 Ben StewartBen Stewart 212 bronze badges2 Answers
Reset to default 1There's a page here about Configuring Automatic Background Updates.
It says specifically not to put the filters in wp-config.php, so you should definitely move those to functions.php; they were probably not registered if added in wp-config.php so that explains why you didn't get plugin or theme updates, but core updates should have worked. Only constants like define( 'WP_AUTO_UPDATE_CORE', true );
should go in wp-config.php.
It's not extremely clear from docs in the codex when or how these auto updates get run, but this article says they're triggered from WP-Cron at 7a.m. and 7pm local time. So you should definitely expect an update to happen within 12-24 hours at the most. Note this is dependent on having enough traffic to your site to trigger WP-Cron.
Docs say that core updates trigger a notification email however plugin and theme updates do not.
Does that help?
Just confirming that I did indeed solve the issue! The problem was the following line within wp-config.php that was put in place by Installatron:
define('AUTOMATIC_UPDATER_DISABLED', true);
Once I updated this to "false", and added the following lines to functions.php, the automatic updates worked perfect:
add_filter( 'auto_update_core', '__return_true' );
add_filter( 'auto_update_plugin', '__return_true' );
add_filter( 'auto_update_theme', '__return_true' );
Hope this helps others with similar problems!