Skip to content

Instantly share code, notes, and snippets.

@herewithme
Created November 19, 2018 16:13
Show Gist options
  • Save herewithme/d42031393c35794bb80e43aec9477afd to your computer and use it in GitHub Desktop.
Save herewithme/d42031393c35794bb80e43aec9477afd to your computer and use it in GitHub Desktop.
Set a role for each users for all sites for WordPress Multisite
for url in $( wp site list --allow-root --field="url" --url="https://XXX" );
do
echo $url;
wp --allow-root user list --network --url="https://XXX" --field=id | xargs -I % wp --allow-root user set-role % administrator --url=$url
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment