Multisite: Hide "Attention! MainWP Child plugin is activated but not connected" Notice

So I realize that MainWP does not advertise itself as fully multisite compatible. However it works enough for what I need it for.

That being said, my multisite installation is a MainWP Child, and has the child plugin network activated. I get the large “Attention! MainWP Child plugin is activated but not connected” notice on each and every sub-site. It doesn’t have a {X} button to close it, and what’s worse is that there aren’t any CSS classes on this notice element, making it particularly difficult and cumbersome to hide if I were to attempt to do this from a styling approach.

Is there a filter hook that I could use that would stop this notice from showing up?

1 Like

Hey @smartstartllc

Welcome to the MainWP community.

Simply hiding that notice and keeping the Child plugin active without connecting the site is not advisable, as it could provide an opening for a potential bad actor to add the site to their own Dashboard.

I would suggest keeping the MainWP Child plugin active on the Network Admin site but deactivating it on subsites that are not added to a MainWP Dashboard.

Fortunately that scenario doesn’t exist in my setup.

Displaying the notice has the dual effect of bringing it to attention that MainWP needs to be activated. None of the users are allowed to activate MainWP base on our capabilities assignment with their role on WordPress. So it is taking up space, and a distracting experience for our users.

So, my question still remains. Is there a filter hook that I could use that can stop the notice from showing up?

We’ve prepared a MainWP Child plugin with an HTML ID element for the notification box: Dropbox - mainwp-child.zip - Simplify your life

The ID will be present in future MainWP Child plugin releases.

I must repeat once more that this is not advisable, and we highly recommend not leaving the MainWP Child plugin active on any sites without adding the site to the MainWP Dashboard.

Add this to your functions.php file, or by using a plugin for code snippets:

function my_custom_admin_styles() {
    echo '<style>
        #mainwp-connection-warning-notice {
            display: none !important;
        }
    </style>';
}
add_action('admin_head', 'my_custom_admin_styles');

That’s perfect! Thank you, advisement considered.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.