Created
August 1, 2023 07:45
-
-
Save thegulshankumar/5545500390948b2de74e60d127755bfc to your computer and use it in GitHub Desktop.
Bulk Migrate All Published Posts to Draft Status via WP CLI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wp post list --post_type=post --format=ids --allow-root | xargs wp post update --post_status=draft --allow-root | |
or | |
wp post update $(wp post list --post_type=post --format=ids --allow-root) --post_status=draft --allow-root |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Enable comment in Bulk
wp post update $(wp post list --post_type=post --orderby=date --order=DESC --format=ids --allow-root) --comment_status=open --allow-root