Multisite tools and awareness
I do a lot of work with WordPress multisite installs, sometimes with hundreds of sites. I'd love for an easier way to query all the sites on the network and get a report, or to issue commands to all sites or a specific subset of sites. I know this is possible with existing bash tools and I use these commonly to solve this as @jeremyfelt discusses here https://jeremyfelt.com/2016/12/22/remove-an-administrator-from-58-networks-at-once-with-wp-cli/, but a common syntax across wp-cli commands would make this easier.
Here's some use cases and proposed commands:
- Change user type from Author to Subscriber on all sites:
wp user set-role zach subscriber --all-sites. Could also see--url=all. - List all plugins and which sites they are active on. Formatting of this report would take some work. This is basically
wp site list --field=url | xargs -I % wp plugin list --url=%from thewp plugin listdocumentation, but I suggest avoiding the piping and xargs to make it more user friendly and just easier interfacing. Proposed commandwp plugin list --all-sites --status=active - Deactivate a plugin on all but one site:
wp plugin deactivate jetpack --all-sites --exclude-url=http://mysite1.example.com
Basically I'm thinking anywhere we're using xargs and pipes to handle something for multisite, integrate this into the wp-cli command itself if possible.
Previously https://github.com/wp-cli/wp-cli/issues/3105#issuecomment-254078799
I still favor additional multisite support, though I understand your conclusion on that other issue :)
Oh, don't get me wrong, I'd love additional support too. I came to the conclusion that it doesn't fit within the concept of aliases syntactically. Happy to consider alternative proposals.