Remove dashboard, use Pages tab as default

The best way is to re-direct user logins to your page and also remove the dashboard from the menu, this can be done with 2 filters.

Redirect logins to your page edit screen example based on user roles, this example uses “author”:

function dashboard_redirect($url) {
    global $current_user;
    // is there a user ?
    if(is_array($current_user->roles)) {
        // check, whether user has the author role:
        if(in_array('author', $current_user->roles)) {
             $url = admin_url('edit.php?post_type=page');
        }
        return $url;
    }
}
add_filter('login_redirect', 'dashboard_redirect');   

Remove the “dashboard from the admin menu”

add_action( 'admin_menu', 'Wps_remove_tools', 99 );
function Wps_remove_tools(){
    
    remove_menu_page( 'index.php' ); //dashboard
  
   }

ps. You can also order the admin menu items using the same filter.

Leave a Comment