Setting up Automatic Update for All WordPress Plugins

As I understand WordPress can automatically install all plugin updates by simply adding this code but inside theme and functions.

add_filter( 'auto_update_plugin', '__return_true' );

Can be set also inside config file as I do not like to limit to one theme.

Not in config file, but a simple one page plugin can be coded where we can put that code →
add_filter( 'auto_update_plugin', '__return_true' );

Thank you for your message!
So, we can

  1. create a file like lib-update-inc.php and
  2. place it with the content below and file it in /wp-content/mu-plugins directory
<?php

/**
 *  Plugin Name: Update WordPress
 */

add_filter( 'auto_update_plugin', '__return_true' ); // Updates Plugins
add_filter( 'auto_update_theme', '__return_true' ); // Updates Themes
add_filter( 'auto_update_translation', '__return_true' ); // Updates Translations

?>
1 Like

You can put it in plugin directory also. Post more questions related to WP we all can benefit.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.