OllieJones / index-wp-mysql-for-speed

A plugin to add useful indexes to your WordPress installation's MySQL database.
GNU General Public License v2.0
128 stars 10 forks source link

Multisite support #57

Open caspahouzer opened 1 year ago

caspahouzer commented 1 year ago

Can you make it working with multisite to apply the changes to all tables in the multisite environment?

OllieJones commented 1 year ago

You can do this site-by-site in multisite setups. I guess you want to be able to handle all the tables for all the subsites from one screen. Or, probably more usefully, from one wp-cli command.

I'll take a look. Thanks for the suggestion.

hj-collab commented 1 year ago

Great feature request! It will save a lot of time for people with large networks / multisite like me.

miscs commented 2 months ago

Can you do it site-by-site with WP_CLI or is this only possible by using the admin UI? A flag like --all-sites would be wonderful ;)

OllieJones commented 2 months ago

Yes, you can do it site by site with WP-CLI.

The plugin offers the --blogid option, so you can say

wp index-mysql enable --all --blogid=1
wp index-mysql enable --all --blogid=2
wp index-mysql enable --all --blogid=3

and so on instead of using --url, if you wish.

You are correct that --all-sites would be a good feature.

joostdekeijzer commented 3 weeks ago

Ran into the same. If you want to live dangerous you can try:

for ID in `wp site list --format=ids` do; wp index-mysql enable --all --blogid=$ID;