WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to have "Pages" set as the default tab when the user logs in to the admin area? I am using a heavily customised set up, where none of the dashboard widgets are useful so they are hidden anyway.

share|improve this question
up vote 3 down vote accepted

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($user->roles)) {
        // check, whether user has the author role:
        if(in_array('author', $current_user->roles)) {
             $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.

share|improve this answer

This is how you remove DASHBOARD on your Wordpress fully !

For who don't want to use plug-in(s), If you installed a plug-in for remove that. You will get extra menu about that plug-in also. What the point ? So you should have control what you do/did


Insert codes on functions.php

Redirect : (When user go to url like domain.com/wp-admin)

function dashboard_redirect(){
    wp_redirect(admin_url('edit.php?post_type=page'));
}
add_action('load-index.php','dashboard_redirect');

Redirect after logged-in : (For prevent logging loop bugs also)

function login_redirect( $redirect_to, $request, $user ){
    return admin_url('edit.php?post_type=page');
}
add_filter('login_redirect','login_redirect',10,3);

Remove the Dashboard menu : (Why do you still have it?)

function remove_menus () {
    global $menu;
    $restricted = array(__('Dashboard'));
    //$restricted = array(__('Dashboard'), __('Posts'), __('Media'), __('Links'), __('Pages'), __('Appearance'), __('Tools'), __('Users'), __('Settings'), __('Comments'), __('Plugins'));
    end($menu);
    while(prev($menu)){
        $value = explode(' ',$menu[key($menu)][0]);
        if(in_array($value[0]!= NULL?$value[0]:'',$restricted)){unset($menu[key($menu)]);}
    }
}
add_action('admin_menu','remove_menus');

Now when user logged-in or go with url like domain.com/wp-admin/ ,..

User will be redirected to domain.com/wp-admin/edit.php?post_type=page


share|improve this answer

Yes, use Adminimize Plugin, remove dashboard and let the pages be the first screen when an use logs in. You can customize it very well and do a fine tuning of the entire admin backend!

UPDATE

Use the filter 'login_redirect' and use the admin_url like in this Wordpress Stackechange post:

Change default admin page for specific role(s)

share|improve this answer
    
I am wary of using such a comprehensive plugin for a single purpose. Ideally I'd build this into my custom themes functions.php – Tom Jan 16 '12 at 13:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.