5 Of The Most Useful WordPress CLI Commands

Over the past 2 years I've been working with more WordPress sites. This article contains the 5 most useful WordPress CLI commands.

Over the past couple of years I've gotten more involved with WordPress site management. One of the tools I seem to find very useful is the WordPress CLI.

WordPress CLI is a command line interface for interacting with a WordPress site.

Below is a small list of the commands I use most frequently.

WordPress logo primarily for presentation purposes.

Plugin updates

First up is a really quick command to run all plugin updates. I find this to be a pretty reliable and easy way of just running updates for all plugins in the repository. Due to the locked down nature of WordPress and the reliance of paid for plugins this command may not get all update but it does work with the vast majority of them.

wp plugin update --all

Theme updates

As above this command is very easy and quick to just run any pending theme updates required on a site.

wp theme update --all

Core updates

Although updating Core in WordPress can be quick in the cms, I find running this alongside the above 2 commands is good practice and can be quite speedy.

wp core update

Translation updates

This is one that often catches me out when running updates and pulling translations into the language folder. This is another 3 quick commands to just get it done.

wp language core update
wp language plugin update --all
wp language theme update --all

Update User Information

Quickly running a password reset on a local or staging environment is something I do frequently. I find this command to be a quick and simple way of doing this.

wp user update <user-id> --user_pass='<password>'

There you have it, 5 of the most useful commands from the WordPress CLI. Often I am running plugin updates or making tweaks to users but let me know what your favourites are in the comments.

Headshot of Jaymeh with slightly smiling face

Posted By: Jaymeh Sykes

On: 14/01/2022


Get in touch: