Here are the top 20 useful WordPress CLI (Command Line Interface) commands:
wp core download: Downloads the latest version of WordPress core files.wp core version: Displays the current version of WordPress.wp core update: Updates WordPress core to the latest version.wp plugin list: Lists all the installed plugins.wp plugin install: Installs a plugin from the WordPress plugin repository.wp plugin activate: Activates a specific plugin.wp plugin deactivate: Deactivates a specific plugin.wp plugin delete: Deletes a specific plugin.wp plugin update: Updates a specific plugin.wp theme list: Lists all the installed themes.wp theme install: Installs a theme from the WordPress theme repository.wp theme activate: Activates a specific theme.wp theme delete: Deletes a specific theme.wp post list: Lists all the published posts.wp post create: Creates a new post.wp post delete: Deletes a specific post.wp post update: Updates a specific post.wp user list: Lists all the registered users.wp user create: Creates a new user.wp user delete: Deletes a specific user.
Additionally, here are some real-life examples for each of the top 20 WordPress CLI commands:
wp core download: To download the latest version of WordPress core files, run the following command:
wp core download
wp core version: To display the current version of WordPress, run the following command:
wp core version
wp core update: To update WordPress core to the latest version, run the following command:
wp core update
wp plugin list: To list all the installed plugins, run the following command:
wp plugin list
wp plugin install: To install a plugin from the WordPress plugin repository, run the following command:
wp plugin install jetpack
This will install the Jetpack plugin.
wp plugin activate: To activate a specific plugin, run the following command:
wp plugin activate jetpack
This will activate the Jetpack plugin.
wp plugin deactivate: To deactivate a specific plugin, run the following command:
wp plugin deactivate jetpack
This will deactivate the Jetpack plugin.
wp plugin delete: To delete a specific plugin, run the following command:
wp plugin delete jetpack
This will delete the Jetpack plugin.
wp plugin update: To update a specific plugin, run the following command:
wp plugin update jetpack
This will update the Jetpack plugin.
wp theme list: To list all the installed themes, run the following command:
wp theme list
wp theme install: To install a theme from the WordPress theme repository, run the following command:
wp theme install twentysixteen
This will install the Twenty Sixteen theme.
wp theme activate: To activate a specific theme, run the following command:
wp theme activate twentysixteen
This will activate the Twenty Sixteen theme.
wp theme delete: To delete a specific theme, run the following command:
wp theme delete twentysixteen
This will delete the Twenty Sixteen theme.
wp post list: To list all the published posts, run the following command:
wp post list
wp post create: To create a new post, run the following command:
wp post create --post_type=post --post_title='New Post' --post_content='This is the content of the new post.'
This will create a new post with the title “New Post” and the content “This is the content of the new post.”
wp post delete: To delete a specific post, run the following command:
wp post delete 123
This will delete the post with the ID of 123.
wp post update: To update a specific post, run the following command:
wp post update 123 --post_title='New Title' --post_content='This is the updated content.'
This will update the post with the ID of 123 with the new title and content.
wp user list: To list all the registered users, run the following command:
wp user list
wp user create: To create a new user, run the following command:
wp user create username email@example.com --user_pass=password
This will create a new user with the username “username”, the email address “email@example.com“, and the password “password”.
These are just a few of the many commands available through the WordPress CLI. For a complete list, you can refer to the official WordPress CLI documentation.




