Skip to content

Instantly share code, notes, and snippets.

@BenBroide
Created July 15, 2018 17:37
Show Gist options
  • Select an option

  • Save BenBroide/17bee76d7a660b8d1f707f1cd6fe72a0 to your computer and use it in GitHub Desktop.

Select an option

Save BenBroide/17bee76d7a660b8d1f707f1cd6fe72a0 to your computer and use it in GitHub Desktop.
Generate posts with wp-cli with multiple meta fields
wp post generate --format=ids --post_type=listing --count=100 | sed -e "s/ /\n/g" | xargs -n1 -I % sh -c 'echo "Adding fields for %"; wp post meta add % _address "531 east 2";wp post meta add % _country "United States"; wp post meta add % _zip "10000"; wp post meta add % _state "NY";wp post meta add % _house 35';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment