Skip to content

Instantly share code, notes, and snippets.

View mustardBees's full-sized avatar

Phil Wylie mustardBees

View GitHub Profile
@mustardBees
mustardBees / distribute_user.sh
Last active August 26, 2022 13:33 — forked from dlh01/distribute_user.sh
WP-CLI: Add a user to all sites in a network
#!/bin/bash
# Save script, run chmod +x on it, then...
# Usage: ./distribute_user.sh [username] [role]
ARGS="$@"
echo "Adding user $1 as $2 to all sites"
SITES=$(wp site list --field=url --format=csv)
for site in $SITES