Disable dashboard for everyone but super admin on multisite solution. Using upfront to update.

Is there a way to disable the dashboard for everyone but Super Admin and have multi-sites managed by Upfront or other front end based widgets etc?

I want to implement a multi-site solution but do not want persons touching the wp dashboard at all to manage it.

Is this possible?

  • Ash

    Hello @Andre

    Welcome to WPMU community!

    I hope you are well today and thanks for asking the question.

    Would you please try the following code?

    add_action('admin_init', 'no_mo_dashboard');
    function no_mo_dashboard() {
      if (!is_super_admin() && $_SERVER['DOING_AJAX'] != '/wp-admin/admin-ajax.php') {
      wp_redirect(home_url()); exit;
      }
    }

    You can add those codes in your functions.php in the theme, if you think your theme won’t be changed. Otherwise mu-plugins is the best solution. To use mu-plugins, go to /wp-content/ and find the folder with name 'mu-plugins'. If there is no folder in that name, then create a folder, name it 'mu-plugins', create a file inside that, give any name you like and paste the code in there. You don't need to activate that plugin. Mu-plugins means must use plugins, so it will be activated automatically always. If you use mu-plugins then add a php start tag at the beginning of the code.

    Hope it helps :slight_smile: Please feel free to ask more question if you have any.

    Cheers
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.