How to redirect user on different page accounding to user (Customer, editor, admin, subscriber and etc)? function wc_custom_user_redirect( $redirect, $user ) { // Get the first of all the roles assigned to the user $role = $user->roles[0]; $dashboard = admin_url(); $myaccount = get_permalink( wc_get_page_id( 'myaccount' ) ); if( $role == 'administrator' ) { //Redirect administrators to the dashboard $redirect = $dashboard; } elseif ( $role == 'shop-manager' ) { //Redirect shop managers to the dashboard $redirect = $dashboard; } elseif ( $role == 'editor' ) { //Redirect editors to the dashboard $redirect = $dashboard; } elseif ( $role == 'author' ) { //Redirect authors to the dashboard $redirect = $dashboard; } elseif ( $role == 'customer' || $role == 'subscriber' ) { //Redirect customers and subscribers to the "My Account" page ...