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