Using WP CLI to manage a Wordpress website Using WP CLI to manage a Wordpress website

October 25, 2023

wordpress bash

I am a big fan of the command line and often have 7 terminal tabs open on my computer. I found the wp-cli tool to manage a Worpdress website from the command line and i love it. It is much faster to use and the WP-CLI tool offers great improvements to manage my wordpress websites from the command-line.

# update the wp-cli tool itself
wp cli update

# update wordpress core
wp core update

# update all the plugins
wp plugin update --all

# update all the themes
wp theme update --all

# export database (to directory)
wp db export /home/andy/wp.sql

# install plugin
wp plugin install wp-statistics

# activate plugin
wp plugin activate wp-statistics

you can see extensive documentation here

It is also possible to extend the wp-cli tool and I have added these 2 tools as well which provide background as to potential problems.

wp doctor

https://managingwp.io/2023/03/31/wp-cli-doctor-command-an-essential-tool-for-wordpress-troubleshooting/

wp vunerability

https://github.com/javiercasares/wpvulnerability

all round it is a great tool to manage the wordpress site from the command line.


If you would like to contact me with this form on londinium.com, ilminster.net or via Twitter @andylondon