Skip to content

WP-CLI command builder

Choose a job, fill in what it needs, and copy the WP-CLI command with its flags in place: updates, backups, getting back into a broken site, replacing an address. Built in your browser.

The job
Which site

Adds --path.

Adds --url.

See what the site is running

Prints the WordPress version, then the plugins and themes with their versions and whether an update is waiting.

bash
wp core version --extra
wp plugin list
wp theme list
Run the lines one at a time, in this order.

What WP-CLI is

WP-CLI is WordPress's command-line tool. It does from a terminal what the dashboard does with clicks, and it still works when the dashboard will not load. How to use WP-CLI covers finding out whether your host has it and installing it where it is missing.

How to use a command

  1. Connect to the server over SSH and go to the folder WordPress is in, or give that folder below.
  2. Choose the job, fill in what it asks, and copy the command.
  3. Paste it into the terminal and read what it prints before you run the next one.

A job that changes the site starts with a line that exports the database. Keep that file until you have seen the site working, then delete it or move it out of the site's folder: left there, anyone who guesses its address can download it.

What it does with what you type

A name or an address you type is put into the command as one word, in quotes where the shell would otherwise read it as something else. Nothing you type is sent to us: the command is built in your browser. No job here asks you for a password. The one that sets a password has WP-CLI ask for it, so it is never part of a command.

When WP-CLI itself fails

WP-CLI loads the site's plugins and theme, so a plugin that breaks the site breaks most commands too. The jobs for getting back in offer two flags, --skip-plugins and --skip-themes, that leave them out. How to deactivate plugins when you are locked out has the whole method.

Common questions

Is every command here safe to run?
Each does what its description says, and the ones that change the site say so and start with a database export. Whether it is the right thing for your site is your call: read the description, and where a job offers it, run it first with the option that only shows what would change.
My host has no SSH. Can I still use these?
Not directly. Some hosts offer a terminal in their control panel, and some will run a WP-CLI command for you if you send it to their support. Most of these jobs can also be done from the dashboard.
It says command not found. What now?
WP-CLI is not installed, or is installed under another name. The guide to using WP-CLI linked above shows how to check and how to install it.
It says this does not seem to be a WordPress installation. Why?
You are not in the folder WordPress is in. Go to the folder that holds wp-config.php, or give that folder in the field for it, which adds --path to the command.

Would you rather we ran it?

Tell us what your site is doing. We reply with the cause and a fixed quote. The diagnosis is free.

Get a free diagnosis