Remove an administrator from 58 networks at once with WP-CLI

Ok, so this is super specific and probably won’t come in handy for you. But it’s another example of how quickly you can perform a task using WP-CLI. At WSU, we currently have 58 networks configured in WordPress multisite. Global administrators are users that have been set under the site_admins¬†option on network 1. Network administrators… Continue reading Remove an administrator from 58 networks at once with WP-CLI

Published
Categorized as Code Tagged

Add users from one site to another on multisite by role with WP-CLI

Today I wanted to make sure a bunch of editors from one site existed as editors of a new staging site that we’re building out. Both sites exist as part of the same multisite network. Thanks to WP-CLI and xargs, this is pretty straight forward: wp user list –role=editor –url=prod.site.edu –field=user_login | xargs -n1 -I… Continue reading Add users from one site to another on multisite by role with WP-CLI