How to Enable Plugin & Theme Updates in WordPress
WordPress should know better
WordPress is the (nearly) perfect CMS for anyone in a hurry. Users familiar with the WordPress interface can navigate quickly through their site and perform operations that require extensive technical knowledge in many competing systems. For example, most maintenance tasks can be performed automatically using simple, one-click operations — and often without the need for additional plugins. These critical includes backups, system upgrades, consistent theme changes, optimization and so on.
However, the configuration necessary to automate some of these tasks sometimes gets in the way. When a WordPress site is required to run off an infrastructure that is not optimized for the platform, or when setting up a local, development copy of an existing site, some configuration is necessary to enable the automated processes to run correctly.
Updating WordPress plugins and themes is one of those tasks that no one wants to perform like it’s 1999. Thanks to continuous integration, plugin updates are dispatched on short cycles — often weekly. Given the number of plugins that can coexist on a single website, it’s best to try and automate the process of maintaining the plugin code to a minimum.
In this short article, I’m going to show you:
- How to quickly enable WordPress updates for plugins and themes directly from the dashboard
- How to turn on fully automatic updates for themes and plugins
- How to configure selective updates
- How to rollback faulty plugin updates
Enabling updates from the WordPress dashboard
Whether working on a client’s site using a local repository, or on your site, you want to make sure that all the updates to the plugins are a single click away, and not something you have to remind yourself to perform to maintain synchronization.
If hitting the core updates button on the admin bar reports a configuration error and forces you to download and update the plugin code manually, you can do this to solve the problem once and for all.
- Add the following line of code to /wp-config.php:
This allows WordPress to access the file system directly instead of requesting an FTP connection.
- Create a folder named upgrade in /wp-content — assuming that it doesn’t exist
This folder holds temporary files while the CMS is performing the theme and plugin updates.
- Using your FTP client or a direct connection, change the permissions of the newly created folder to 775
This change allows the system to use the directory you just created to store the temporary files.
That’s all you need. Now all the updates WordPress is warning you about can be performed in a single step.
Automatic updates for themes and plugins
If you want to take automation a step further and let WordPress take care of all the plugin and theme upgrades autonomously, add the following lines to the functions.php file (/wp-includes/functions.php):
add_filter( 'auto_update_plugin', '__return_true' ); add_filter( 'auto_update_theme', '__return_true' );
Configuring selective updates (automation)
If you are worried about automated updates playing tricks with your site and would rather have some specific plugins refrain from updating automatically, you can use Automatic Plugin Updates (https://wordpress.org/plugins/automatic-plugin-updates/ ). This plugin will let you exclude the plugins you want to keep off the automated list. Yes, that list includes the Automatic Plugin Updates itself!
Rolling back problematic plugin updates
Finally, because everything is now fully autonomous, you might want an insurance policy on your sanity and install WP Rollback (https://wordpress.org/plugins/wp-rollback/). This plugin allows you to quickly and easily reverse the effects of an upgrade. The easy rollback process might save your sanity if you catch such an update misbehaving and messing up with the rest of your site.
That’s all, folks!
In this quick walkthrough, I showed you how to enable direct theme and plugin updates through the administration dashboard, how to tell WordPress to update them automatically, how to keep some plugins off the automation process, and how to rollback an update in case you discover a conflict. If you have any problem with your WordPress site, don’t hesitate to reach out to our development team: https://dev.codecide.net