Skip to content

Instantly share code, notes, and snippets.

@prasadnevase
Created March 27, 2018 17:22
Show Gist options
  • Save prasadnevase/71bb5bf59ff591acfba778a516a5cf1a to your computer and use it in GitHub Desktop.
Save prasadnevase/71bb5bf59ff591acfba778a516a5cf1a to your computer and use it in GitHub Desktop.
Delete all products from trash using wp cli
wp post delete $(wp post list --post_type='product' --post_status=trash --format=ids)
@prasadnevase
Copy link
Author

This is useful when there are 1000s of products in trash and your server is timing out when you try to clean your trash from WordPress backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment