Home Articles Platform info WordPress Helpful WP-CLI commands

Helpful WP-CLI commands

We use WP-CLI a lot, and here is the most common WP-CLI commands we use in a cheat sheet.

WP-CLI man pages

wp

Create admin user

wp user create [username] [e-mail] --role=administrator

List all users:

wp user list

Replace all URLs in the database

wp search-replace [old url] [new url] --all-tables

List plugins 

wp plugin list

To get the status of all plugins

wp plugin status

Run Servebolt Optimizer Analyze tables

wp servebolt db analyze

Analyzing tables will make the db update it’s indexes

Did this help you?