Unlock Hidden Powers: Transform Your WordPress Workflow with WP-CLI Today!
wp post list
Once you have the IDs for each post you want to update, you can refer to them in the command, separated by a space.
Here’s an example of a wp post update command that updates multiple posts:
wp post update 1 125 283 --post_author=2
This command changes the author of the posts with IDs 1, 125, and 283 to the user with ID 2.

(To view the list of users and their IDs, use the wp user list command.)
To build upon that command, if you wanted to change the author of all posts by a specific author to a different author, you could use this command:



Post Comment