How to manage WordPress posts using WP-CLI

In our last article we went thru some wp-cli usage examples and got a bit familiar with the wp-cli tool. In this article we will see how we can manage our posts using the wp-cli tool.

The basic syntax is :

 So let us give some examples of the most common and useful post activities using the wp-cli tool.

How to list all the posts in WordPress using WP-CLI

 

How to list all the posts for a specific user in WordPress using WP-CLI

 

How to create new post in WordPress using WP-CLI

 

How to edit a post in WordPress using WP-CLI

 

How to change the wp-cli editor

  • you can choose your preffred editor, the only thing you need to do is added in your .bashrc file.

Assuming vim is your editor of choice

Similar Article  Examples of how to use Wordpress WP-CLI

How to delete a post in WordPress using WP-CLI

How to delete all posts from the trash in WordPress using WP-CLI

How to update the Name a post in WordPress using WP-CLI

We will update the post name.

 

How to update the Title of a post in WordPress using WP-CLI

 

Still wanna know more about WP-CLI ? Read the next article on what are the database operations we can do with WP-CLI.

 

   

I hope this was helpful and i appreciate if you would like, subscribe or share our posts. I it is just a click

clickhere

No Comments
Leave a Comment

%d bloggers like this: