is there a code or plugin that would restrict access to the main sites dashboard to everyone but me(

as the super admin i dont want any other user to have access to my main sites dashboard.

i currently have a code in place that restricts access to my main sites dashboard…only problem is the that the code is set up so that user also doesnt have access to even their own dashboard meaning that cant edit their blog in any way.

i think i may have found a way around this.

could i possibly use the “quick page/ post redirect” plugin to block ALL access to the main sites dashboard?

or could i use the “user redirect” plugin?

is there a code for this?

in plain english…i want no user but me(SUPER ADMIN) to have access to the main dashboard…i want it to be a restricted area…kinda like the back of a store…customers arent allowed back there…

  • aecnu
    • WP Unicorn

    Greetings airot87,

    Thank you for the question and are you referring to sub site members or?

    Sub site members should not have access to the main sites dashboard in any event.

    Are you using two completely different browsers for developing and testing? i.e. Firefox for developing and Chrome for testing and dumping the caching and cookies of the test browser before each test?

    Let us know.

    Cheers, Joe

  • Greta (M3PCS)
    • New Recruit

    Hi there,

    Please make sure that you have ftp access in the event it fails miserably.. and you get locked out of your own admin..

    (1) keep a backup of your functions.php of Main Site

    (2) create a copy of backup and add the code to the bottom

    (3) upload the revised functions.php

    Log into your Site as Super Admin in One browser(eg Chrome)

    And try to log in as another user from another Browser (eg FireFox)

    (2 browsers enables 2 different logged in cookies)

    The “Other User should be redirected to the Home Page of the main site..

    function main_site_restrict_admin() {
    global $blog_id;
    //Are we on Main Site (get from global $blog_id=1)
    //Check to see if user has super admin capability of manage_network
    //AND make sure its not an AJAX request from within wp
    if ($blog_id == 1 && !current_user_can( 'manage_network' ) && $_SERVER['PHP_SELF'] != '/wp-admin/admin-ajax.php' ) {
    // IF the user is not the super admin redirect to the home page.
    wp_redirect( home_url() );
    add_action( 'admin_init', 'main_site_restrict_admin', 1 );

    What the function should do:

    1) Grabs the Global Variable for the $blog_id (the Main site in Multisite standard install is 1)

    2) Checks if the Current user who is trying to log in has the manage_network capability (this capability is unique to users with the role of super admin)

    3) Checks to make sure that the request for the wp-admin backend is not WordPress itself (Ajax functions do need access).

    IF the user does not have the capability and the other conditions apply, then redirect those folks to the home page of the site.

    Untested, but hopefully it will steer you in the right direction..

  • airot87
    • Design Lord, Child of Thor

    thanks guys! i found a plugin called Admin Menu Editor in which i can basically make items in the menu disappear. thats great but id prefer a code because as we know plugins can and do become outdated at some point…maybe WPMUDEV could create their own plugin like this?…just a thought (;

  • Greta (M3PCS)
    • New Recruit

    Hi there @airot87!

    The code I provided previously is the function on the linked page by @hpidriver with two additions: (1) It checks to see if the visitor is on the Main Site in the Multisite network (global $blog_id == 1) and second it runs a check to see if the current user is a Super Admin ( current_user_can( ‘manage_network’ ) ). So the code I provided should work for keeping all users except Super Admin out of the Main Site Back End/Dashboard.

    warmest regards,


  • _981
    • Site Builder, Child of Zeus

    User the WPMU Membership Plugin!

    You can add users automatically to an access level you create. You can limit the user from seeing specific or all parts of the admin dashboard.

    The Membership plugin can work for “Free” just to note, it’s not just to charge a fee for access levels. Theres a “Free” addon option within the Membership plugin options.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.