You would need to add the following code in your theme’s functions.php file
function analytify_dashboard_redirect( $redirect_to, $request, $user ) { if ( ! is_wp_error( $user ) ) { return ( is_array( $user->roles ) && in_array( 'administrator', $user->roles ) ) ? admin_url( 'admin.php?page=analytify-dashboard' ) : $redirect_to; } } add_filter( 'login_redirect', 'analytify_dashboard_redirect', 10, 3 );