green and black digital device

WP CLI Basics

If you manage WordPress sites, WP CLI is definitely a tool that you should check out and consider using if you aren’t already.

WP CLI offers a massive set of tools to use via SSH, managing your WordPress installs without needing to login to the backend (WordPress Dashboard).

In this guide, we won’t be going over installing WP CLI, though you can learn more about that here [link to new guide].

Many of the commands are pretty self-explanatory, though we’ll go over some other use cases rather than just listing the commands and all of the parameters that can be used.

wp core

wp core version

Check the current WordPress version

wp db version

Check the current WordPress version

wp core verify-checksums

Verify that core files have not been modified

wp core update

Update the core to a newer version

Examples of using wp core:

wp core download --version=6.1.1 --skip-content --force

wp plugin

wp plugin list

Get a list of all plugins, installed active and inactive

wp plugin verify-checksums

Verify that plugin files have not been modified

wp plugin update

Update a plugin

wp theme

wp theme list

Show a list of installed themes

wp theme update

Update a theme

wp db

wp db size

Check the current database size

wp db optimize

Optimize the database

wp db prefix

Return the current database tables prefix

wp db search

Search the entire database for a string

Examples of using wp db:

wp db size --human-readable

Ready for more WP CLI?

Ok, if you say so… Go check out Beginner’s Guide to WP CLI: The Ultimate Resource for WordPress Enthusiasts

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.