Hide dashboard from non-admin users

Is it possible to hide the dashboard completely from the Non-admin users and give them access to only New post and edit posts page?
Thanks.

Related posts

Leave a Reply

4 comments

  1. As far as ease of use, especially for WordPress Admins not too firm in PHP, I second brasoflo’s plugin recommendation (Adminimize).

    For the sake of completeness, this is how it’d be done programmatically:

    /* Remove the "Dashboard" from the admin menu for non-admin users */
    function wpse52752_remove_dashboard () {
        global $current_user, $menu, $submenu;
        get_currentuserinfo();
    
        if( ! in_array( 'administrator', $current_user->roles ) ) {
            reset( $menu );
            $page = key( $menu );
            while( ( __( 'Dashboard' ) != $menu[$page][0] ) && next( $menu ) ) {
                $page = key( $menu );
            }
            if( __( 'Dashboard' ) == $menu[$page][0] ) {
                unset( $menu[$page] );
            }
            reset($menu);
            $page = key($menu);
            while ( ! $current_user->has_cap( $menu[$page][1] ) && next( $menu ) ) {
                $page = key( $menu );
            }
            if ( preg_match( '#wp-admin/?(index.php)?$#', $_SERVER['REQUEST_URI'] ) &&
                ( 'index.php' != $menu[$page][2] ) ) {
                    wp_redirect( get_option( 'siteurl' ) . '/wp-admin/edit.php');
            }
        }
    }
    add_action('admin_menu', 'wpse52752_remove_dashboard');
    
  2. You can use the plugin Adminimize to do that.

    It is possible to hide the Dashboard (and many other things) based on the user role. In case of hiding the Dashboard, you can define to what page the user will be redirected.

    I’m not sure, but I believe you cannot modify the user roles to block the Dashboard (as even the lowest role has access to it).

    But if you combine Adminimize with a Role plugin, you can achieve a very fine tuned administrative interface.

  3. Those 2 pages too are a part of the dashboard! If you’re giving access to edit posts, means you’re giving access to the posts list. The lowest capable role, subscriber, also has access to the profile page, which is also a part of the dashboard! Your best option would be a front end post addition/profile editing form.

  4. you can use a plugin called “User Role Editor”.. You cant avoid dashboard in order to give them access to the New post.. But you can limit their role…