• I’m starting a private WP site using the ‘Members’ plugin. All students are ‘subscribers’ with only the ability to read posts.

    Ideally, i’d like to admin pages to only show the basic profile info (name / contact / about). If they go to the admin page, they are currently able to see a few things that I wish they didn’t:

    • “Security Points’ rating for Ultimate Security checker (but don’t have sufficient permissions to make changes of course
    • WordPress button and support links. Not needed for them
    • They can access the dashboard, also not needed, it’s just wordpress news.
    • I’ve got qtranslate and they can see a link for each different language. but links are dead because of their role.

    What is the best way to selectively remove items from the admin panel?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    For the WordPress button and support links, and the Ultimate Security checker you can put this in your theme’s functions.php :

    add_action( 'admin_bar_menu', 'remove_toolbar_items_for_subscribers', 999 );
    function remove_toolbar_items_for_subscribers( $wp_admin_bar ) {
      if(current_user_can('subscriber')) {
        $wp_admin_bar->remove_node('theme_options');
        $wp_admin_bar->remove_node('wp-logo');
      }
    }

    Try a plugin for the dashboard: https://wordpress.org/extend/plugins/wp-hide-dashboard/

    Moderator keesiemeijer

    (@keesiemeijer)

    Try it with this in your functions.php for qtranslate:

    if(is_admin()){
        add_action('admin_menu', 'remove_q_links');
      }
      function remove_q_links(){
        global $q_config, $pagenow;
        if(current_user_can('subscriber')) {
          if(sizeof($q_config['enabled_languages']) <= 1) return;
          foreach($q_config['enabled_languages'] as $id => $language) {
            $menu_slug = $pagenow.'?lang='.$language;
            remove_menu_page( $menu_slug );
          }
        }
      }

    Thread Starter Vezado

    (@vezado)

    Thanks for your help.

    I was able to remove the admin bar entirely for subscribers using the plugin ‘Adminimizer’ and I found that qtranslate has an option to remove the buttons:

    http://wordpress.org/support/topic/plugin-qtranslate-remove-flags-in-admin-menu?replies=2

    I’ll add a modified version of your first script for myself, that’s useful.

    Moderator keesiemeijer

    (@keesiemeijer)

    I found that qtranslate has an option to remove the buttons

    Hacking the plugin is of course also a way to do it. But then you have to add the line of code every time you update the plugin.

    Glad you got it resolved.

    Thread Starter Vezado

    (@vezado)

    Hacking the plugin is of course also a way to do it. But then you have to add the line of code every time you update the plugin.

    Good point, i had thought of that. The developer needs to move that config option into the admin settings, editing a php file is lousy way to set options.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Limit what certain roles see on profile / admin page’ is closed to new replies.