Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Redirect away from login page

The login_init hook is the first one to be called in wp-login.php, so try hooking into it instead.

function redirect_invalid_login()
{
    global $error;

    if( $error )
    {
        wp_redirect( get_bloginfo( 'url' ) . '/client-login/?message=6' );
        die();
    }
}
add_action( 'login_init', 'redirect_invalid_login' );

If that doesn’t work, please provide more details.

Related Posts:

  1. Custom login form redirect to external site
  2. Clarification on auth_redirect()
  3. How to redirect all requests to wp-login.php?
  4. Redirect user after login/registration globally
  5. Remove lost password form and URL
  6. How to auto login after registration? [duplicate]
  7. Change ‘Back To Website’ link in wp-login.php
  8. Redirect when accessing /login when logged in
  9. Redirect outside WP after login
  10. wp_login_form redirect problem
  11. How to redirect wp_login_form to new page after user loged in?
  12. redirect doesn’t work while using example code
  13. Disable redirect to homepage after successful Login, Stay on Current Page
  14. wp_login_form() redirect same page
  15. Determine user destination on wp-login.php
  16. Redirect after login when WordPress in subdirectory
  17. Login redirects to home page and doesn’t log in
  18. Custom login-form redirect
  19. Login Form Redirection
  20. Redirect user to login and then to page where they came from
  21. Redirect after registration and auto login is not working
  22. PHP header(Location: …): Force URL change in address bar
  23. What does HTTP/1.1 302 mean exactly?
  24. php refresh current page?
  25. How to force a 404 on WordPress
  26. Disable front end to use as CMS only?
  27. Redirect Restricted Page to 404
  28. How to redirect non-logged in users to a specific page?
  29. How to prevent automatic redirection of 404 errors and “incorrect” URLs?
  30. How do I skip wordpress’s 404 handling and redirect all 404 errors for static files to 404.html?
  31. Disable WordPress URL auto complete
  32. Host the wp-admin on another domain?
  33. Redirect user to original url after login?
  34. Unable to login and wp-login.php redirects to wp-admin%2F&reauth=1?
  35. When I change slug, will WordPress create redirect from the old URL?
  36. WordPress localhost site redirect to live site
  37. WordPress redirecting connections on port 8080 to 80
  38. WordPress Redirect All HTTP requests to HTTPS via .htaccess
  39. wp_redirect() function is not working
  40. Redirect entire website to a single page
  41. My wordpress multisite homepage redirects to signup page
  42. Logout redirect to home page
  43. Disable ONLY URL auto complete, not the whole canonical URL system
  44. Redirect Localhost wordpress site to dashboard
  45. Redirect page URL to home URL without using a plugin
  46. Why is WordPress redirecting from http to https on a local environment?
  47. Login redirect to previous page
  48. How to prevent redirect to ‘About’ after core upgrade?
  49. 301 redirect instead of 404 when URL is a prefix of a post or page name?
  50. Why is wp_redirect() preferable to a standard PHP header redirect?
  51. How do I programmatically generate a 404?
  52. Redirect to referring page after logging in
  53. User redirect to destination URL after login
  54. Prevent access to single post types
  55. check first time login only
  56. How to change the default logout link on WordPress Admin
  57. Stop WordPress from “guessing” redirects for nonexistent URLs
  58. WordPress install enters an infinite loop
  59. How to redirect a sucessful registration to a page template?
  60. How to configure nginx to redirect requests to the uploads directory to the production server?
  61. WordPress HTTPS redirect loop
  62. Why am I getting a 301 on a existing post?
  63. Redirect to dashboard after login
  64. Make a video post redirect to next post after completion
  65. Old blog/ and blog/feed/ URLs not working after moving blog to top-level via .htaccess
  66. Non-WordPress page in subdirectory under WordPress page
  67. Force HTTPS using .htaccess – stuck in redirect loop
  68. How to redirect after login, the working way?
  69. Keeps on redirecting on my development copy
  70. Password change when the user login first time
  71. Redirecting WordPress /.htaccess / HSTS / SSL
  72. 301 redirect not working through .htaccess
  73. handling login/logout redirects
  74. Logout/login redirect CSS issue
  75. Site redirects to wrong url when saving settings
  76. Implementing global redirection (automatic redirect for all pages who had their slug changed)
  77. Correct way to hide pseudo pages from being shown?
  78. Redirect blog page to latest post?
  79. Redirect to custom url when registration fails?
  80. Why does WordPress automatically redirect URLs with the parameter “name=” to a different page?
  81. prevent/block direct access to a thank you page
  82. Redirect After Delete User in Backend
  83. Exclude a path from WordPress using .htaccess redirects (Apache)
  84. Restrict Access to wp-login.php
  85. How to setup 301 redirects for multiple query string URLs?
  86. How to redirect url requests to https? [closed]
  87. Using `auth_redirect` : keeps asking me to login even when I’m logged in
  88. Htaccess redirect from ‘/%postname%.html’ to ‘/%postname%’
  89. Redirect to post after submission with Gravity Forms? [closed]
  90. How can I move/redirect single blog posts from one blog to another?
  91. Best way to handle redirects
  92. WordPress site redirects to different wordpress domain on the same server after reuploading db backup
  93. Redirecting old permalink to new one
  94. WP auto redirects after url change?
  95. Setting a redirect cookie in wordpress
  96. Index in root, wordpress in subdirectory
  97. Redirect www to non-www htaccess
  98. 302 redirect instead of 301 after switch to HTTPS
  99. Stop WordPress Redirection From /keyword to /some-post-containing-keyword/
  100. Specific URL has 403 Forbidden status code
Categories redirect Tags redirect, wp-login-form
Custom dashboard widget search box
WP Customer Reviews – shortcodes

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress