[ad_1]
I see the use-case, but it indeed seems a little overkill for Unbloater to have its own import/export section…
All settings are stored in one wp_options field (unbloater_settings) though, so it’s quite easy to read/write those just about with any tool (PHP, or even CLI I guess).
I personally use ManageWP and their Code Snippets feature to set stuff like this on multiple sites. Remotely configuring your sites might be a better approach than to log in to every site and import for each one.
Thats a good hint! Installed ManageWP.
Would you mind providing an code example?
Thank you. Roman
The settings are basically stored as an array of options. You can read them from a site by running this:
print_r( get_option( 'unbloater_settings' ) );
Writing options should work along the lines of this:
$settings = array(
'remove_update_available_notice' => 1,
'disable_auto_updates_core' => 0,
...
);
update_option( 'unbloater_settings', $settings );As of now, all of the options are checkboxes, so it’s only a matter of setting 0 (inactive) or 1 (active) for each option.
Just make sure to include all of the options when saving the settings programmatically, otherwise they’ll be unset.
Changing just one option on a site can be achieved like this:
$settings = get_option( 'unbloater_settings' );
$settings['disable_auto_updates_core'] = 0;
update_option( 'unbloater_settings', $settings );That’s basically reading the current settings, changing a value and finally saving the changes to the database.
Great – thank you. I appreciate this!
Schönes Wochenende. Roman
