Login-form wrong password – no error-message appears
-
Hello community,
when I typ a wrong password or wrong username/email no error-message “The username or password you entered is incorrect.” appears.
The website url only change to /?login=fail with the code
add_action( ‘wp_login_failed’, ‘my_login_fail’ );
function my_login_fail( $username ) {
$referrer = $_SERVER[‘HTTP_REFERER’]; // where did the post submission come from?
// if there’s a valid referrer, and it’s not the default log-in screen
if ( !empty($referrer) && !strstr($referrer,’wp-login’) && !strstr($referrer,’wp-admin’) ) {
wp_redirect( $referrer . ‘?login=failed’ ); // let’s append some information (login=failed) to the URL for the theme to use
exit;
}
}Maybe you have a solutions for this. Please help!
Thank you in advance.
Kind regards,
Johannes
-
Hey @yourkinkz do you have any other login/registration/security plugins installed that might be interfering? WPUM doesn’t redirect to that URL
Hello Plugin Author,
I have implemented the previously mentioned code to redirect to that URL otherwise it directs with wrong password login to our homepage..
I use the Astra Theme.
I use another plugins like BuddyPress and Youzify for the Forum and Profile-page not for login/registration.
Today I find out that the Youzify plugin interfering with the WP User Manager, when I deactivate Youzify the error-message “Authentication failed” appears.
The problem is I need Youzify.. how can I show the error-message then and how can I translate the message because I don´t see it in the loco translate plugin.
The problem with redirection to the homepage url is solved and no other code is needed.
Problem has been solved with the Youzify-Plugin.
If you use another plugin to handle Login and Registration for, you can disable Youzify form by turn off Youzify Membership. It’s on Youzify Panel >> General Settings.
The topic ‘Login-form wrong password – no error-message appears’ is closed to new replies.