Skip to content

Instantly share code, notes, and snippets.

@michael-sumner
Last active May 23, 2024 11:52
Show Gist options
  • Save michael-sumner/f21c2b70255a51379df960f307a968f8 to your computer and use it in GitHub Desktop.
Save michael-sumner/f21c2b70255a51379df960f307a968f8 to your computer and use it in GitHub Desktop.
Set the existing user as administrator role across all sites in the WordPress multi-site network
# wp site list --field=url | xargs -I % sh -c 'wp user set-role <user-login> <role> --url=%'
#
# For example:
wp site list --field=url | xargs -I % sh -c 'wp user set-role testuser administrator --url=%'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment