I asked about this questions earlier. How to stop navigating to default wp login page when wrong username or password given and to give error message on the same page like ajax.
Im using easywp namecheap hosting so ftp logins will work only for 12 hrs when generated.
Code you send before was not working to stop directing
I have checked on our demo site and the code works fine. In this case, you can try the following code:
add_action( 'wp_login_failed', 'custom_login_failed' );
function custom_login_failed( $username )
$referrer = wp_get_referer();
if ( $referrer && ! strstr($referrer, 'wp-login') && ! strstr($referrer,'wp-admin') )
wp_redirect( add_query_arg('login', 'failed', $referrer) );
If you still face their issue, you can send me the username & password of your site for further checking.
Any more infos?
Please login or Register to submit your answer