User role to manage Members without being full admin

Hi,

Is there a way to have a user role so someone on our staff can manage all the members, but without full admin access?

Thanks!

Harry

  • Majid

    Hey Harry
    I hope you are having a wonderful day :slight_smile:

    This can be done using a plugin called User Role Editor that you can download from here https://wordpress.org/plugins/user-role-editor/

    Once that done, it will add a section under Users and under each user's profile, since you don't want the whole role type to have the ability of editing other users, let's set it up for just one user.

    1. Navigate to Users > All users and edit the member you wish to grant this ability to
    2. At the bottom of the user profile, you will see a new section like in the screenshot, click Edit capabilities.

    3. Click users under All/Core capabilities, this will bring up the list of capabilities related to the users. check all of them and click update.

    Let me know if you need any further assistance
    Cheers,
    Majid

  • Majid

    Hello Harry,
    Yes managing WP settings and Membership 2 Pro settings are actually tied together, so the only way to achieve the results wanted is by removing the WordPress settings pages from that user, please try adding the following code to your theme's functions.php and make sure you change the user ID (it was 11 ofr my test case to) the user allowed to edit MS2 settings.

    function remove_settings_page() {
    	// 11 is the user ID that will be granted to manage Membership options, but not WordPress options pages
    	// Change it accordignly
    	if( 11 == get_current_user_id() ) {
    		remove_menu_page( 'options-general.php' );
    	}
    }
    add_action( 'admin_menu', 'remove_settings_page' );
    
    function restrict_settings_page_access( $current_screen ) {
    	$base = $current_screen->base;
    	$user_id = get_current_user_id();
    
    	// 11 is the user ID that will be granted to manage Membership options, but not WordPress options pages
    	if( 11 == $user_id && ( 'options-general' == $base || 'options-writing' == $base || 'options-reading' == $base || 'options-discussion' == $base || 'options-media' == $base || 'options-permalink' == $base ) ) {
    		wp_die( 'Sorry you don\'t have access to this page.' );
    	}
    }
    add_action( 'current_screen', 'restrict_settings_page_access' );

    Let us know how it went in a reply !
    Thanks :slight_smile:
    Majid

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.