WP CLI Command Generator

The WordPress CLI (WP-CLI) provides a command line interface for managing WordPress. This page provides multiple generators and command examples to make things a bit easier for those who are just starting out with WP-CLI. It can also save time for some of the longer commands.

Common Commands

These are the most common commands you will use with the WP-CLI

Update WordPress

Apply updates to the WordPress Core

Update Plugins

Apply updates to one or all plugins

Update Themes

Apply updates to one or all themes

Add a user

Create a user on your site

Delete a user

Remove a user from your site

Flush Cache

Purge the cache set by a caching plugin

Plugins

Work with Plugins via the WP-CLI

List Installed Plugins

Get a list of installed plugins and update check

Install a Plugin

Use the WP-CLI to install a plugin

Deactivate a Plugin

Use the WP-CLI to deactivate a plugin. Does not remove.

Get Rename-WP Login

Find the URL of Rename-WP Login (if installed)

Themes

Work with Themes via the WP-CLI

List Installed Themes

Get a list of installed themes and update check

Install a Theme

Use the WP-CLI to install a theme

Remove a Theme

Use the WP-CLI to remove a non-active theme

Users

Manage users via the WP-CLI

Users List

Get a complete list of the users on your site

Update a user

Update a username, email address, password, and/or user role

User Roles

Get a list of installed plugins and update check

Restore User Roles

Restore the default user roles

Miscellaneous

Get information, change settings, and more

WordPress Version

Find out what version you are running

Moderation Notification

Enable or Disable comment moderation notifications

Comment Notification

Enable or Disable comment notifications

Database

Use WordPress to perform common database actions

Optimize Database

Clear overhead and optimize your database

Repair Database

Make WordPress automatically repair database tables