Super Admin questions

Hello Support

Not sure if I can ask the question here.

I am managing my company's multisite, I need all users as super admin since they need to access all sub-sites. but I cannot let them to access something, like Plugins, Themes etc...

I tried User Role Editor, this is a good plugin but seems not helpful for my situation.

Do you have any recommendation for me?

Thank you
Eric

  • Sajid

    Hello Eric,
    Hope you are doing good today :slight_smile:

    Yes, you can indeed ask any question related to our products and WordPress/BuddyPress in general. We will try our best to answer to all your question.

    Back to your question. You can try this plugin to hide some elements for some users on your website.
    https://wordpress.org/plugins/adminimize/

    Hope that helps! Feel free to post a reply if you need further assistance :slight_smile:

    Best Regards,
    Sajid

  • Sajid

    Hello IT,
    Hope you are doing good today :slight_smile:

    So you want to restrict access for user base instead of user level.

    If yes then I could not find a free plugin for this. However, I find Admin Menu editor plugin that lets you do this but you need to buy a pro version for this.

    Please make sure you try the free version first and contact their sales support to confirm if it will work the way you want.

    Here is the plugin link:
    https://wordpress.org/plugins/admin-menu-editor/

    Take care and have a nice day :slight_smile:

    Best Regards,
    Sajid

  • IT

    Hi Sajid

    I have purchased the plugin, this is actually what I need!! Thanks for your suggestion.

    BTW, the plugin do not support network admin panel so that I am now using code to remove items in network admin panel, see below.

    /* remove items from network admin panel */
    add_action( 'network_admin_menu', 'remove_links_menu' );
    function remove_links_menu() {
    remove_menu_page('index.php'); // Dashboard
    remove_menu_page('edit.php'); // Posts
    remove_menu_page('upload.php'); // Media
    remove_menu_page('link-manager.php'); // Links
    remove_menu_page('edit.php?post_type=page'); // Pages
    remove_menu_page('edit-comments.php'); // Comments
    remove_menu_page('themes.php'); // Appearance
    remove_menu_page('plugins_LIMIT_TO_USER','1'); // Plugins
    remove_menu_page('users.php'); // Users

    }

    Can you please also suggest me what code should I use to remove WPMU DEV's plugin?

    "Snapshot"
    "Hummingbird"
    "Defender"

    I don't want other users access these 3 plugin.

    I am using code to limit WPMUDEV Dashboard to my user ID now, can I do this for these plugins?
    define('WPMUDEV_LIMIT_TO_USER', '1');

    Besides, do you think I can limit all things above to my user ID instead remove?

    Thank you
    Eric

  • Nastia

    Hello Eric, I hope you are doing well today!

    I had a chat with our developers and they provided a code for you.

    For Snapshot network admin menu use the bellow code:
    remove_menu_page('snapshots_edit_panel');

    For the Hummingbird plugin:
    remove_menu_page("wphb");

    And for the Defender plugin, our devlopers alos asked to set action's priority to 99:

    add_action( 'network_admin_menu', 'remove_links_menu', 99 );
    function remove_links_menu() {
      remove_menu_page( 'wp-defender' );

    I am using code to limit WPMUDEV Dashboard to my user ID now, can I do this for these plugins?
    define('WPMUDEV_LIMIT_TO_USER', '1');

    Adding this line to wp-config.php is unnecessary, you can as well limit access to WPMU DEV Dashboard from WPMU DEV > Manage > Permissions section. Add only your account there. This way no other admin/ super admin will not see the WPMU DEV Dashboard.

    I hope this will help!

    Kind regards,
    Nastia

  • IT

    Thanks Nastia

    it works like charm!!!

    BTW, I am just wondering is there any way to create a sub-site and only assign for a user to access?
    no others can see the new sub-site even Super Admin?

    I am ready to create a test a new theme, so that I want to create a new sub-site, but since this is testing, I don't want other users (all my colleagues are Super Admin) see this and access.

    Can I?

    B.Rgds
    Eric

  • Sajid

    Hello IT,

    Hope you are doing good today :slight_smile:

    You can remove a specific site from sites list in Network -> Sites -> All Sites by using the following code.

    add_action('parse_site_query', 'wpmudev_remove_specific_site_from_list');
    function wpmudev_remove_specific_site_from_list( $wp_site_query ){
    
    	$site_id = 'REPLACE_THIS_WITH_SITE_ID';
    
    	$wp_site_query->query_vars['site__not_in'] = array( $site_id );
    
    	return $wp_site_query;
    }

    Make sure you replace the text with the ID of that site.

    Further more, in case some one have direct link, then you can make to go away by using the following code.

    add_action('init', 'wpmudev_lock_specific_site_from_all_users');
    function wpmudev_lock_specific_site_from_all_users(){
    
    	$current_blog_id			=	get_current_blog_id();
    	$current_user_id			=	get_current_user_id();
    
    	$locked_site_id				=	'REPLACE_THIS_WITH_LOCKED_SITE_ID';
    	$locked_site_owner_id		=	'REPLACE_THIS_WITH_SITE_OWNER_ID';
    
    	if( $locked_site_id == $current_blog_id and $current_user_id != $locked_site_owner_id ){
    
    		wp_redirect( 'https://www.google.com' );
    		exit();
    
    	}
    }

    Again, don't forget to replace the dummy text with corresponding IDs of site and owner of that site id so they could access it.

    Hope that helps! Feel free to post a reply if you need further assistance :slight_smile:

    Best Regards,
    Sajid

  • Sajid

    Hello IT :slight_smile:

    As you confirmed the above code did not caused this issue, so its recommended to create a separate ticket for us to troubleshoot it further.

    This will help us focus on single issue per thread to avoid any confusions and also helps other members find an answer quickly for future.

    Take care and have a nice day :slight_smile:

    Best Regards,
    Sajid - WPMU DEV Support

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.