Hi, I want to view the settings in my child sites, without changing them. Can I do this via the Bulk Settings Manager?
Thanks
Hi, I want to view the settings in my child sites, without changing them. Can I do this via the Bulk Settings Manager?
Thanks
Hey @clgm
Bulk Settings Manager is basically one-way. Itâs designed to send a set of captured settings/values to child sites. It doesnât read or pull back the current settings from each child site, so there isnât a built-in âview child site settings (read-only)â option in Bulk Settings Manager.
The only workaround I can think of is the Code Snippets extension, but itâs not very user-friendly.
Youâd need to write a custom snippet that reads the pluginâs settings from the child site database. That means youâd have to figure out where that plugin stores its options (sometimes itâs wp_options, but it can also be custom tables, custom post types, serialized data, etc.).
Then youâd run that snippet across your child sites and have it return the values back to the MainWP Dashboard.
So itâs technically possible, but it requires you to do all the heavy lifting of mapping the pluginâs settings to database values, which quickly turns into a pretty big âdatasetâ if youâre trying to audit a lot of settings.
Hi @bojan thanks for your reply. I will have a go with Code Snippets. If I succeed, Iâll post the code here for others to use ![]()
Hi @bojan in this case, I want to get a list of the Administration Email Address of child sites. So itâs not a plugin. Itâs the contents of the admin_email field in the wp_options table.
The SQL query would be
SELECT option_value FROM `wp_options` WHERE option_name='admin_email'
I tried this code snippet
global $admin_email; $admin_email->query( " SELECT option_value FROM `wp_options` WHERE option_name='admin_email' "); echo $admin_email;
and received this error: âMainWP Child plugin not detected or could not be reached! Ensure the MainWP Child plugin is installed and activated on the child site, and there are no security rules blocking requests.â
The child site has the MainWP Child plugin installed and activated. Does that mean that there are security rules blocking the request? The child site is hosted on WP Engine. I tried adding the following MainWP user-agent to the WPE allowlist
Mozilla/5.0 (compatible; MainWP/6.0.1; +http://mainwp.com)
but got the same error.
Or is there an error in the snippet?
Hi @clgm
If you mean the WordPress setting from Settings > General > Administration Email Address, use:
echo get_option(âadmin_emailâ);
Snippet type should be Return info from Child Sites.
And for a nicer formatting which includes the site name and URL, you can use:
echo get_bloginfo(ânameâ) . â | â . home_url() . â | â . get_option(âadmin_emailâ);