ideas icon indicating copy to clipboard operation
ideas copied to clipboard

Multisite tools and awareness

Open TheLastCicada opened this issue 8 years ago • 3 comments

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 the wp plugin list documentation, but I suggest avoiding the piping and xargs to make it more user friendly and just easier interfacing. Proposed command wp 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.

TheLastCicada avatar Jan 15 '17 19:01 TheLastCicada

Previously https://github.com/wp-cli/wp-cli/issues/3105#issuecomment-254078799

danielbachhuber avatar Jan 16 '17 14:01 danielbachhuber

I still favor additional multisite support, though I understand your conclusion on that other issue :)

TheLastCicada avatar Jan 17 '17 18:01 TheLastCicada

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.

danielbachhuber avatar Jan 17 '17 19:01 danielbachhuber