Unlock Hidden Powers: Transform Your WordPress Workflow with WP-CLI Today!
Again, the post IDs are used when specifying which post(s) to delete:
wp post delete 649

To delete multiple posts, separate the IDs with a space:
wp post delete 649 300 150
By default, posts are moved to the trash. However, you can use the –force flag to skip the trash folder and delete the post:
wp post delete 648 --force
If you want to delete all pages, you can use the following command:
wp post delete $(wp post list --post_type=page --format=ids)

This command deletes all posts by a specific user:



Post Comment