Last active
April 7, 2019 20:02
-
-
Save BenBroide/ad3481e1907a078a595b43108a55919d to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
for post in $(wp post list --field=ID --allow-root) | |
do | |
count=$(wp post term list $post 'category' --fields='name' --format="count" --allow-root) | |
if [ "$count" -gt "1" ] | |
then | |
wp post term remove $post category 'uncategorized' --allow-root | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment