Skip to content

Instantly share code, notes, and snippets.

@michael-sumner
Created October 22, 2024 12:37
Show Gist options
  • Save michael-sumner/630365159ea6736171bc4724ac84c1f4 to your computer and use it in GitHub Desktop.
Save michael-sumner/630365159ea6736171bc4724ac84c1f4 to your computer and use it in GitHub Desktop.
WPVIP - loop through all sites in network - set user to administrator role
# 1. Save the commands.sh file somewhere (no need to commit to repository).
# 2. Run `chmod +x ./commands.sh` to allow permission to run the file.
# 3. Run `./commands.sh` to run the file.
env="@99999.develop"
sites=$(vip $env -- wp site list --field=url)
for site in $sites; do
vip $env -- wp user set-role michaelsumner administrator --url=$site
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment