-
-
Save fernandovbs/e5dfc3b92649dd0773fa234a575e97d5 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