Skip to content

Instantly share code, notes, and snippets.

@fernandovbs
Last active June 15, 2022 22:23
Show Gist options
  • Save fernandovbs/b059b7a6861bc33df71a64403147f0de to your computer and use it in GitHub Desktop.
Save fernandovbs/b059b7a6861bc33df71a64403147f0de to your computer and use it in GitHub Desktop.
Bulk update wc membership user plans for all customers
wp wc user_membership list --field=id --user=id5 --allow-root | xargs -n1 wp wc user_membership update --plan_id="274" --user=USER_NAME
#wp wc user_membership list can limit the results. An alternative is to use wp post list to get all membership posts:
wp post list --post_type=wc_user_membership --field=ID | xargs -n1 wp wc user_membership update --plan_id="274" --user=USER_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment