Automatic WordPress updates

WordPress has implemented background updates natively since version 3.7 and automatically activated them for minor releases. With the help of filters you can control the behavior more precisely what exactly is updated automatically. A permanent, fully automatic installation of all minor, major, plugin, theme and translation updates is not planned, but can easily be done otherwise.

There are numerous plugins that increase the frequency with which notifications are called up and, in some cases, also promise to carry out the actual updates; But none of these plugins succeeds reliably. The powerful command line tool WP-CLI offers a very suitable solution (not only for this purpose). After a short installation, the following lines (executed in the WP project folder) ensure that all updates for the above components are installed without exception:


The following oneliner (which can be shortened using an alias or with tools like flimsy ) can be run on any SSH server (even without a previously installed WP-CLI) to install all updates in one go:


The --allow-root flag ensures that systems can run as a root user (this is essential in WSL environments). An update of any component without prior testing in a local development environment is not recommended under any circumstances. However, if you have a shielded WP environment or a special use case that you always want to be supplied with the latest updates, the whole thing can also be automated via a simple cron job in the form of a bash file:


WP-CLI can do a lot more: add user roles, delete comments, search for and replace strings in databases, import media files ... it's worth taking a look at the documentation . At the moment I have opened two Github issues that concern small bugs in the language module , but do not stand in the way of use in productive environments.