Skip to content

The top 20 useful WordPress CLI (Command Line Interface) commands

May 4, 2023 | WordPress

Here are the top 20 useful WordPress CLI (Command Line Interface) commands:

  1. wp core download: Downloads the latest version of WordPress core files.
  2. wp core version: Displays the current version of WordPress.
  3. wp core update: Updates WordPress core to the latest version.
  4. wp plugin list: Lists all the installed plugins.
  5. wp plugin install: Installs a plugin from the WordPress plugin repository.
  6. wp plugin activate: Activates a specific plugin.
  7. wp plugin deactivate: Deactivates a specific plugin.
  8. wp plugin delete: Deletes a specific plugin.
  9. wp plugin update: Updates a specific plugin.
  10. wp theme list: Lists all the installed themes.
  11. wp theme install: Installs a theme from the WordPress theme repository.
  12. wp theme activate: Activates a specific theme.
  13. wp theme delete: Deletes a specific theme.
  14. wp post list: Lists all the published posts.
  15. wp post create: Creates a new post.
  16. wp post delete: Deletes a specific post.
  17. wp post update: Updates a specific post.
  18. wp user list: Lists all the registered users.
  19. wp user create: Creates a new user.
  20. wp user delete: Deletes a specific user.

Additionally, here are some real-life examples for each of the top 20 WordPress CLI commands:

  1. wp core download: To download the latest version of WordPress core files, run the following command:
wp core download
  1. wp core version: To display the current version of WordPress, run the following command:
wp core version
  1. wp core update: To update WordPress core to the latest version, run the following command:
wp core update
  1. wp plugin list: To list all the installed plugins, run the following command:
wp plugin list
  1. 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.

  1. wp plugin activate: To activate a specific plugin, run the following command:
wp plugin activate jetpack

This will activate the Jetpack plugin.

  1. wp plugin deactivate: To deactivate a specific plugin, run the following command:
wp plugin deactivate jetpack

This will deactivate the Jetpack plugin.

  1. wp plugin delete: To delete a specific plugin, run the following command:
wp plugin delete jetpack

This will delete the Jetpack plugin.

  1. wp plugin update: To update a specific plugin, run the following command:
wp plugin update jetpack

This will update the Jetpack plugin.

  1. wp theme list: To list all the installed themes, run the following command:
wp theme list
  1. 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.

  1. wp theme activate: To activate a specific theme, run the following command:
wp theme activate twentysixteen

This will activate the Twenty Sixteen theme.

  1. wp theme delete: To delete a specific theme, run the following command:
wp theme delete twentysixteen

This will delete the Twenty Sixteen theme.

  1. wp post list: To list all the published posts, run the following command:
wp post list
  1. 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.”

  1. 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.

  1. 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.

  1. wp user list: To list all the registered users, run the following command:
wp user list
  1. 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.

Contact Us Today!

"*" indicates required fields

This field is for validation purposes and should be left unchanged.
I would like to be contacted by:*
Select all that apply.

Join Our Newsletter List!

* indicates required