WP Cli – post add meta in xargs after wp post generate – add multiple fields

This command will generate posts and create a field with key “bar” and value “foo”

wp post generate –format=ids –count=10 | xargs -d ‘ ‘ -I % wp post meta add % foo bar

This does not seem to work:

wp post generate –format=ids –count=10 | xargs -d ‘ ‘ -I % wp post meta add % foo bar ; wp post meta add % key_2 value_2

How could create 2 meta fields and values after the wp post generate command?

Read more here:: WP Cli – post add meta in xargs after wp post generate – add multiple fields

Leave a Reply

Your email address will not be published. Required fields are marked *