-
-
Save quangbahoa/0104e32ded9f0c003a226d6cfb009cc9 to your computer and use it in GitHub Desktop.
Bulk update all product posts in WooCommerce with a post status of publish or draft using a WP-CLI command
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
# Bulk update all product posts with a post status of publish to draft | |
wp post list --field=ID --post_type=product --posts_per_page=500 --post_status=publish | xargs wp post update --post_status=draft | |
# Bulk update all product posts with a post status of draft to publish | |
wp post list --field=ID --post_type=product --posts_per_page=500 --post_status=draft | xargs wp post update --post_status=publish |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment