Created
June 10, 2020 21:50
-
-
Save wpjess/74f276fee9f3cab9a58b6f0c309f57d6 to your computer and use it in GitHub Desktop.
Update WordPress post terms for group of IDs
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
#!/bin/bash | |
# Store the file post_ids as a variable | |
POST_IDS=$(<post_ids) | |
# Loop through each of these IDs | |
for POST_ID in $POST_IDS | |
do | |
wp-cli post term set "$POST_ID" category uncategorized --path=/htdocs/__wp__ | |
echo "Processing post ID $POST_ID..." | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
post_ids is a simple file containing a list of IDs, like so:
17635
9863
12904
31220