WPIntell

Source evidence

Login fail redirect

Sidebar Login Widget · support · 2014-04-07T04:55:00+00:00

complaintsentiment
mediumseverity
0.92relevance
5replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

3 / 32 rows with source links

9.4% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

29 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
lauriekane@yahoo.com unresolved
Hi, How can I redirect to login.php when login fails? https://wordpress.org/plugins/tt-sidebar-login-widget/ Yes I am getting an error with login fail also. The URL is: http://www.mydomain.com/?login=failed&errcode=incorrect_password But it goes back to the homepage. This plugin is developed in that way. When login attempt is failed it will redirect to home page. Because sidebar login widget will be on the home page sidebar in most of the cases so user can try to login again. But if you want that after the login failure it will be redirected to worpress login screen then replace the following code wp_redirect(home_url() . '/?login=failed&errcode='.$current_error ); with wp_redirect( $referrer . '/wp-login.php' ); This line is in function called “handle_login_failure” Hope that will help. Thanks for the quick reply! In my case at least, there is no sidebar on the homepage. The code you’ve suggested (thanks!) adds the /wp-login.php to whatever the current URL is, so this doesn’t work if the login sidebar is on another page. I would suggest the following instead: wp_redirect( home_url() . '/wp-login.php' ); Bridie Yes thats definitely a solution but i just figured out both our solution may end up with redirection loop problem for some hosts. The best way to redirect to wp-login page is disable/remove the following portion of code and let wordpress handle it. add_action('wp_login_failed', 'handle_login_failure'); /* * This method will handle the login failure process. */ function handle_login_failure($username){ // check what page the login attempt is coming from global $current_error; $referrer = $_SERVER['HTTP_REFERER']; if ( !empty($referrer) && !strstr($referrer,'wp-login') && !strstr($referrer,'wp-admin') ) { wp_redirect(home_url() . '/?login=failed&errcode='.$current_error ); exit; } } Hi, I would like to be able to add link that goes directly to WP Login page. Actually when it redirect to the homepage where there is the Widget. The problem is that widget is in the bottom of the page, so not easy to find the right way for users to log in or register. Is there’s a way to make the link go straight to the WP login page or to force it to go there ? Thanks.

Comments

5 shown
bridieamelia 2014-04-07T23:56:00+00:00

Yes I am getting an error with login fail also. The URL is: http://www.mydomain.com/?login=failed&errcode=incorrect_password But it goes back to the homepage.

Rashed Latif 2014-04-08T00:37:00+00:00

This plugin is developed in that way. When login attempt is failed it will redirect to home page. Because sidebar login widget will be on the home page sidebar in most of the cases so user can try to login again. But if you want that after the login failure it will be redirected to worpress login screen then replace the following code wp_redirect(home_url() . '/?login=failed&errcode='.$current_error ); with wp_redirect( $referrer . '/wp-login.php' ); This line is in function called “handle_login_failure” Hope that will help.

bridieamelia 2014-04-08T01:02:00+00:00

Thanks for the quick reply! In my case at least, there is no sidebar on the homepage. The code you’ve suggested (thanks!) adds the /wp-login.php to whatever the current URL is, so this doesn’t work if the login sidebar is on another page. I would suggest the following instead: wp_redirect( home_url() . '/wp-login.php' ); Bridie

Rashed Latif 2014-04-08T03:54:00+00:00

Yes thats definitely a solution but i just figured out both our solution may end up with redirection loop problem for some hosts. The best way to redirect to wp-login page is disable/remove the following portion of code and let wordpress handle it. add_action('wp_login_failed', 'handle_login_failure'); /* * This method will handle the login failure process. */ function handle_login_failure($username){ // check what page the login attempt is coming from global $current_error; $referrer = $_SERVER['HTTP_REFERER']; if ( !empty($referrer) && !strstr($referrer,'wp-login') && !strstr($referrer,'wp-admin') ) { wp_redirect(home_url() . '/?login=failed&errcode='.$current_error ); exit; } }

amadreamer 2015-01-31T10:17:00+00:00

Hi, I would like to be able to add link that goes directly to WP Login page. Actually when it redirect to the homepage where there is the Widget. The problem is that widget is in the bottom of the page, so not easy to find the right way for users to log in or register. Is there’s a way to make the link go straight to the WP login page or to force it to go there ? Thanks.