How to auto update WordPress plugins and Themes

It’s always very important to keep your WordPress installation, plugins and downloaded themes up to date.

Hackers will always find a way to hack into your WordPress website through vulnerable and outdated plugins and themes.

So to avoid this, WordPress has made it possible for you to auto update your plugins and themes by adding a few lines of code to your wp-config.php file. So whenever a update is available for your plugins or themes, WordPress will automatically download and install the latest version of that plugin or theme.

Here is the code that you need to add

To auto update your WordPress plugins add:

add_filter( ‘auto_update_plugin’, ‘__return_true’ );

To auto update your WordPress themes add:

add_filter( ‘auto_update_theme’, ‘__return_true’ );