Last Updated: February 25, 2016
·
484
· 1fixdotio

Skip dashboard when log into WordPress

If you are like most of my clients, don’t want to do an extra click after logging into WordPress. This tip is for you. Put this snippet in functions.php:

function my_login_redirect( $redirect_to, $url, $user ) {

    if ( ! is_wp_error( $user ) && user_can( $user, 'edit_posts' ) ) {
        $redirect_to = admin_url( 'edit.php' );
    }

    return $redirect_to;
}
add_filter( 'login_redirect', 'my_login_redirect', 10, 3 );