Created
May 11, 2017 18:01
-
-
Save ptasker/1c8e5affd1e214263cbe3bc1bcbfe09a to your computer and use it in GitHub Desktop.
WP CLI remove all media
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
#!/usr/bin/env bash | |
DIR="$1" | |
if [ -z "$1" ] | |
then | |
echo "Usage: $0 {WP install dir path}" | |
exit 1 | |
fi | |
cd $DIR | |
pwd | |
wp post delete $(wp post list --post_type='attachment' --format=ids) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ypsilon-p
Error: Parameter errors:
unknown --post_type parameter
unknown --format parameter
unknown --allow-root) parameter
Kindly help me to solve it