WP Cli – post add meta in xargs after wp post generate – add multiple fields
You just need to change the syntax of xargs to run multiple commands using the same placeholder: wp post generate –format=ids –count=10 | sed -e “s/ /\n/g” | xargs -n1 -I % sh -c ‘echo “Adding fields for %”; wp post meta add % foo bar; wp post meta add % key_2 value_2’; Update: The … Read more