- WP-CLI – What is it? WP-CLI provides a command-line interface for many actions you might perform in the WordPress admin dashboard.
- Why use it? It’s fast. Faster than using the WordPress admin (not as many “clicks”) and faster than performing modifications via FTP. Also, comes in quite handy if your frozen out of the admin.
- How is it used? For example, you can manage site users by typing the command: wp users. You can download, install and activate a plugin in seconds with: wp plugin. See the interactive table below for a list of commands.
- What else? WP-CLI also includes commands for many things you can’t do in the WordPress admin or via FTP. For example, the command: wp transient delete, lets you delete one or all transients from your database.
- SSH – You need SSH (Secure Shell) access. SSH allows you remotely operate network services securely. It’s the “gateway” through your site’s hosting server to WP-CLI. Many, but not all web hosts, provide SSH access. Some do, but without access to WP-CLI. We provide both at our web hosting sister site; The Site Hosting Co. If you are not hosted with us, ask your web host for support.
- SSH Client – You need an SSH Client to access your site’s hosting server. This is software you download and install to your desktop/laptop. If you are a Windows user, this is a must. Mac, you can use the built-in Terminal function. PuTTY is an SSH Client you can download and use for free. It’s a small executable file with no setup or instructions required. Just download, click to install, and you are good to go. For details in connecting to your site through PuTTY, see the infographic below.
Hover your mouse over this image to reveal instructions:
WP-CLI COMMANDSA list of useful commands you can use with WP-CLI
|COMMAND (click the links for more information)||PURPOSE|
|wp cache||Manage the object cache|
|wp cap||Manage user capabilities|
|wp checksum||Verify WordPress core checksums|
|wp cli||Review current WP-CLI info, check for updates, or see defined aliases|
|wp comment||Manage comments|
|wp config||Manage the wp-config.php file|
|wp core||Download, install, update and manage a WordPress install|
|wp cron||Manage WP-Cron events and schedules|
|wp db||Perform basic database operations using credentials stored in wp-config.php|
|wp eval||Execute arbitrary PHP code|
|wp eval-file||Load and execute a PHP file|
|wp export||Export WordPress content to a WXR file|
|wp help||Get help on WP-CLI, or on a specific command|
|wp import||Import content from a WXR file|
|wp language||Change language for WordPress|
|wp media||Import new attachments or regenerate existing ones|
|wp menu||List, create, assign, and delete menus|
|wp network||Manage multisite|
|wp option||Manage options|
|wp package||Manage WP-CLI packages|
|wp plugin||Manage plugins|
|wp post||Manage posts|
|wp post-type||Manage post types|
|wp rewrite||Manage rewrite rules|
|wp role||Manage user roles|
|wp scaffold||Generate code for post types, taxonomies, plugins, child themes, etc.|
|wp search-replace||Search/replace strings in the database|
|wp server||Launch PHP’s built-in web server for this specific WordPress installation|
|wp shell||Interactive PHP console|
|wp sidebar||Manage sidebars|
|wp site||Perform site-wide operations|
|wp super-admin||Manage super admins on WordPress multisite|
|wp taxonomy||Manage taxonomies|
|wp term||Manage terms|
|wp theme||Manage themes|
|wp transient||Manage transients|
|wp user||Manage users|
|wp widget||Manage sidebar widgets|