-
-
Save Clickys/38c837504a87a48060eac206ccda11cb to your computer and use it in GitHub Desktop.
Delete unattached images using WP-CLI
This file contains hidden or 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 delete $(wp post list --post_type='attachment' --format=ids --post_parent=0) | |
| wp post delete $(wp post list --post_type='attachment' \ | |
| --format=ids --post_parent=0 --post_mime_type='image/jpeg') | |
| wp post delete $(wp post list --post_type='attachment' \ | |
| --format=ids --post_parent=0 --post_mime_type='image/png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment