Nexcess Logo

WordPress Automatic Updates for Plugins & Themes

Knowledge Base Home

Notice anything different?

We've enhanced the appearance of our portal and we're working on updating screenshots. Things might look different, but the functionality remains the same.
December 21, 2021


Want to use the command line to enable and disable WordPress automatic updates for plugins/themes? Learn how to use the WP-CLI tool to manage auto updates!

How to Enable & Disable WordPress Automatic Updates for Plugins & Themes Using WP-CLI


As is often the case, we already know how to enable and disable WordPress automatic updates for plugins/themes directly from WordPress and the Nexcess Portal:



As an alternative method in this article, we'll focus on how to accomplish this via the commands provided in the WP-CLI tool:

...a listing of all currently available WP-CLI commands with links to documentation on usage and subcommands.

In short, WP-CLI is a command-line tool for managing your WordPress installations.

Prerequisites


To start, log in to your website server using you4 SSH credentials via the SSH client. Once in, make sure you're in the valid directory, and in this case, we'll need to be in the directory of your WordPress installation:

[wpclitesting@host ~]$ cd public_html/

If you can see your WordPress configuration files listed, you’re in the right place: 

[wpclitesting@host public_html]$ ls
cgi-bin    license.txt  wp-activate.php  wp-blog-header.php    wp-config.php         wp-content   wp-includes        wp-load.php   wp-mail.php      wp-signup.php     xmlrpc.php
index.php  readme.html  wp-admin         wp-comments-post.php  wp-config-sample.php  wp-cron.php  wp-links-opml.php  wp-login.php  wp-settings.php  wp-trackback.php

WordPress Automatic Updates for Plugins

Detailed information about the command we’re going to use for this can be found in the wp plugin auto-updates <command> documentation, but you can also always get help directly in the command line:

[wpclitesting@host public_html]$ wp help plugin auto-updates

To begin with, let’s start by checking the status of the WordPress automatic updates for all our plugins with the following command:

[wpclitesting@host public_html]$ wp plugin auto-updates status --all
+---------------------+----------+
| name                | status   |
+---------------------+----------+
| akismet             | disabled |
| hello               | disabled |
| pagelayer           | disabled |
| popularfx-templates | disabled |
+---------------------+----------+

However, if you wish to check the status of WordPress automatic updates for some particular plugin, you can specify it in the command like this:

[wpclitesting@host public_html]$ wp plugin auto-updates status pagelayer
+-----------+----------+
| name      | status   |
+-----------+----------+
| pagelayer | disabled |
+-----------+----------+

Now, if we would like to enable WordPress automatic updates for some particular plugin, we can do it like this:

[wpclitesting@host public_html]$ wp plugin auto-updates enable pagelayer
Success: Enabled 1 of 1 plugin auto-updates.
[wpclitesting@host public_html]$ wp plugin auto-updates status pagelayer
+-----------+---------+
| name      | status  |
+-----------+---------+
| pagelayer | enabled |
+-----------+---------+

And, in case we decide to enable the WordPress automatic updates for all our plugins, we can also do it with a single command:

[wpclitesting@host public_html]$ wp plugin auto-updates enable --all
Success: Enabled 4 of 4 plugin auto-updates.
[wpclitesting@host public_html]$ wp plugin auto-updates status --all
+---------------------+---------+
| name                | status  |
+---------------------+---------+
| akismet             | enabled |
| hello               | enabled |
| pagelayer           | enabled |
| popularfx-templates | enabled |
+---------------------+---------+

Now, if we change our mind and want to disable automatic updates for a single plugin or for all of them, we can easily do that with WP-CLI as well:

[wpclitesting@host public_html]$ wp plugin auto-updates disable pagelayer
Success: Disabled 1 of 1 plugin auto-updates.
[wpclitesting@host public_html]$ wp plugin auto-updates status pagelayer
+-----------+----------+
| name      | status   |
+-----------+----------+
| pagelayer | disabled |
+-----------+----------+

[wpclitesting@host public_html]$ wp plugin auto-updates disable --all
Success: Disabled 4 of 4 plugin auto-updates.
[wpclitesting@host public_html]$ wp plugin auto-updates status --all
+---------------------+----------+
| name                | status   |
+---------------------+----------+
| akismet             | disabled |
| hello               | disabled |
| pagelayer           | disabled |
| popularfx-templates | disabled |
+---------------------+----------+

WordPress Automatic Updates for Themes

Similar to the previous command, we can also get help on how to use the command directly in the command line, or, if you prefer, you can open up the wp theme auto-updates <command> documentation as a guide.

[wpclitesting@host public_html]$ wp help theme auto-updates

The command usage is quite similar to the previously used one, and to check the status of WordPress automatic updates for all our themes, we can use the following command:

[wpclitesting@host public_html]$ wp theme auto-updates status --all
+-----------------+----------+
| name            | status   |
+-----------------+----------+
| popularfx       | disabled |
| twentynineteen  | disabled |
| twentytwenty    | disabled |
| twentytwentyone | disabled |
+-----------------+----------+

If you would like to check are automatic updates enabled for some specific theme, you can do it by specifying the theme name in the command like this:

[wpclitesting@host public_html]$ wp theme auto-updates status twentynineteen
+----------------+----------+
| name           | status   |
+----------------+----------+
| twentynineteen | disabled |
+----------------+----------+

To change the status of automatic updates and enable them, for example, for the twentynineteen theme, use this command:

[wpclitesting@host public_html]$ wp theme auto-updates enable twentynineteen
Success: Enabled 1 of 1 theme auto-updates.
[wpclitesting@host public_html]$ wp theme auto-updates status twentynineteen
+----------------+---------+
| name           | status  |
+----------------+---------+
| twentynineteen | enabled |
+----------------+---------+

But if you would like to enable the automatic updates for all the themes you have, you can do that as well:

[wpclitesting@host public_html]$ wp theme auto-updates enable --all
Success: Enabled 4 of 4 theme auto-updates.
[wpclitesting@host public_html]$ wp theme auto-updates status --all
+-----------------+---------+
| name            | status  |
+-----------------+---------+
| popularfx       | enabled |
| twentynineteen  | enabled |
| twentytwenty    | enabled |
| twentytwentyone | enabled |
+-----------------+---------+

Of course, if you wish to disable automatic updates for one theme or for all of them, you can accomplish that with WP-CLI:

[wpclitesting@host public_html]$ wp theme auto-updates disable --all
Success: Disabled 4 of 4 theme auto-updates.
[wpclitesting@host public_html]$ wp theme auto-updates status --all
+-----------------+----------+
| name            | status   |
+-----------------+----------+
| popularfx       | disabled |
| twentynineteen  | disabled |
| twentytwenty    | disabled |
| twentytwentyone | disabled |
+-----------------+----------+

[wpclitesting@host public_html]$ wp theme auto-updates disable twentynineteen
Success: Disabled 1 of 1 theme auto-updates.
[wpclitesting@host public_html]$ wp theme auto-updates status twentynineteen
+----------------+----------+
| name           | status   |
+----------------+----------+
| twentynineteen | disabled |
+----------------+----------+

Conclusion

WP-CLI is a versatile and nifty tool that helps us manage WordPress installation quickly and efficiently with basic command-line knowledge. Also, keeping your plugins and themes up to date is one of the essential things for having a secure website. 

Useful YouTube > Nexcess Channel Links

Resources for More Information

Need more help? The Applications > WordPress sections within the Nexcess Knowledge Base are important resources for those seeking additional knowledge. Or, check out our related articles below.

Support: 24-Hour Assistance

If you need any assistance with the above-mentioned, don't hesitate to reach out. For 24-hour assistance any day of the year, Nexcess customers can contact our support team by email or through your Client Portal.

New Customers: Fully Managed Hosting Solutions


Not a Nexcess customer yet? Check out our fully managed hosting solutions. The option to chat with an expert is also available.

Related Articles



Isabel Kettnich
We use cookies to understand how you interact with our site, to personalize and streamline your experience, and to tailor advertising. By continuing to use our site, you accept our use of cookies and accept our Privacy Policy.