Updating plugin settings on all subsites

(Rob) #1

Hello WP Chat,

I have a multisite with several subsites.
Some plugins have a global settings page in the Network Admin area making it easy to update settings for those plugins across all subsites.

Many plugins don’t have a global settings panel :frowning:
They need to be configured site-by-site, but I was hoping there is a shortcut for when I start having many subsites. Updating a plugin on a 100 or more sites will start to become a lengthy process. In my case the site’s content will be different but the plugin and settings will be the same across all sites.

Is there a way to propagate such plugin settings across all subsites?
I would imagine the process would consist making a change on one site then looking at the database and identifying those changes. Then updating the databases of the subsites with the changes.

Is that the right direction? Any other ideas or tips regarding this?

(Jason) #2

That’s an interesting use-case. I haven’t had to worry about that yet.

Since it’s options being updated, I would throw together a script that hooks into update_option which then determines if the “master” site is updating its options. I’d probably put in a few more checks to make sure the updating isn’t coming from some page I want to be unique on a per site basis, then go through the site option tables and update the value for each one.

That’s my initial thought. The biggest thing you’d need to think through with this method is making sure you’re not updating what you shouldn’t (i.e. General settings), and ask yourself the question of what happens when the user updates something for the sub-site. Should they be able to? If not how do you communicate that? If so how do you preserve settings that they’ve made?

Fun little mental experiment. :slight_smile:

(Martin) #3

I’m running into the exact same issue. It seems to me it would be a not uncommon need. There’s an out-of-date sitewide options plugin that attempted to do exactly this. Does anyone know if an up-to-date plugin like this is available?