WordPress CLI cheatsheet. Commands That You Must Know

Posted by TotalDC

WP-CLI is a tool that gives you ability to admin your WordPress website through a command line. You can execute standard functions like plugin installation or commands that are not supported through the standard WP backend. List of useful WordPress CLI commands below.

Download WordPress –>

wp core download

Generate wp-config.php file –>

wp core config –dbname=<dbname> –dbuser=<dbuser> –dbpass=<dbpass> –dbprefix=<dbprefix>

Install WordPress ->

wp core install –url=”your domain name” –title=”your blog title” –admin_user=”admin” –admin_password=”your password” –admin_email =”your email”

Search plugin ->

wp plugin search yoast

Install plugin ->

wp plugin install pluginname

List plugins ->

wp plugin list

List installed themes->

wp theme list

Search for new themes->

wp theme search keyword

Install theme->

wp theme install theme name

Activate theme->

wp theme activate theme name

List posts->

wp post list

Edit post->

wp post edit 1

Post update->

wp post update 1 –post_title=”your post title”

Create posts->

wp post create –post status=publish –post_title=”your post title” –edit

Login WordPress db->

wp db cli

List WordPress users->

wp post update 6 –post_author=1

Optimize db->

wp db optimize

Update WordPress->

wp core update-db

Update all plugins->

wp plugin update –all

Leave a Reply

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

%d bloggers like this: