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

Remove lost password form and URL

Hi Please try to use this in your functions.php it will redirect user to login form when user try to access lost password page:

add_action('init','possibly_redirect'); 
function possibly_redirect(){ 
   if (isset( $_GET['action'] )){  
     if ( in_array( $_GET['action'], array('lostpassword', 'retrievepassword') ) ) {
        wp_redirect( '/wp-login.php' ); exit;
     }
  }
}

Or Please follow below approach used from this answer answered here with some details based on comments of @Clarus Dignus

function disable_lost_password() {
    if (isset( $_GET['action'] )){
        if ( in_array( $_GET['action'], array('lostpassword', 'retrievepassword') ) ) {
            wp_redirect( wp_login_url(), 301 );
            exit;
        }
    }
}
add_action( "login_init", "disable_lost_password" );

Related Posts:

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

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