Change admin startpage to Pages-page?

When you login to the admin you see the Welcome page by default. A client of mine requested to see the “Pages” page by default, he had seen it somewhere else.

Is this possible, and if so, how? Tried searching but found nothing relevant, didn’t find it in the settings either.

Related posts

Leave a Reply

2 comments

  1. This should work for you if you put it in your themes functions.php file, but you may want to modify the conditions, and the url to redirect to depending on your set up.

    function loginRedirect( $redirect_to, $request, $user ){
        if( is_array( $user->roles ) ) { // check if user has a role
            return "/wp-admin/edit.php?post_type=page";
        }
    }
    add_filter("login_redirect", "loginRedirect", 10, 3);
    

    Here’s a link containing more info about using the login_redirect filter:
    http://codex.wordpress.org/Plugin_API/Filter_Reference/login_redirect

    There’s also a few login redirect plugins floating around if you do a google search.

  2. Great answer from Ben

    to improve on it add home_url() to allow this to work on localhost or server.

    if( is_array( $user->roles ) ) {
        return home_url() . "/wp-admin/edit.php?post_type=page";
    }