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

wp-login – unable to redirect user to a custom login url

what I need to do is to rename the wp-login.php page in login.php or login and I’ve tried using .htaccess rewrite rule

Is there something else I can do to achive this?

No, wp-login.php cannot be moved or rewritten, not without modifying WordPress core. That particular approach to this is a dead end.

But the login URL can be swapped/replaced with something that is not wp-login.php.

The commonly accepted approach to this problem is to instead use the login_url filter to change where WordPress thinks the login URL is and point it to a custom login page of your own creation. How that page is constructed is up to you, e.g. you could use wp_login_form(), or construct the form yourself, or use widgets/blocks/plugins/form plugins/etc to do it. There are many ways to do this.

This does mean that you’ll need to build that custom login page, and style it, and depending on how you build it will determine how much effort is required. How you do that would make a good question on this stack, but there are already lots of questions, and even entire tags dedicated to this subject.

If you just want to see the standard login page that you get out of the box, but at a different URL, then no, WordPress provides no way to do that via configuration/code/filters.

Related Posts:

  1. PHP – redirect https to http and www to non-www
  2. How to turn off redirection from ‘domain.com/login’ to ‘domain.com/wp-login.php’
  3. PHP If user is logged in & on home page redirect
  4. 3 blogs same installation, without WP MU
  5. Problem with login form
  6. How to redirect users based on role and content of redirect_to?
  7. How to allow download url redirection only if user logged in WordPress site?
  8. Infinite loop when logging out using custom login form
  9. Need help with AJAX login to call php in functions.php to handle redirects based on user cap (role)
  10. wp-login.php?redirect_to=https problem
  11. WordPress Redirect / Add_Rewrite_Rule – Non Index.php Page
  12. redirect 301 with special character like WIX site “#!”
  13. 301 redirect from webpage to wordpress page in the same root
  14. 3 domains, 1 wordpress install, redirecting and changing domains on live site
  15. Redirect users not logged in to the standard login page (and back) from some posts and pages
  16. How to use multiple 404 Error Pages in WordPress
  17. wp_login_url always redirects me to wp-admin
  18. Redirect to current URL and append specified URL parameter on unsuccessful login through Elementor login form widget
  19. Cant login to wp-admin (redirecting to homepage), But CAN login to wp-login.php
  20. Cant login to wp-admin (redirecting to homepage), But CAN login to wp-login.php
  21. How to redirect users to custom lostpassword page?
  22. Which ways can be used to log in to WordPress?
  23. Can’t access admin dashboard with wp-admin without /index.php after it
  24. How to resolve error “Cookies are blocked due to unexpected output.”?
  25. How to override .htaccess with new rules without ftp or edit it manual
  26. Remove username in emails or swap username for email
  27. woocommerce and is_user_logged_in() if not redirect to homepage
  28. Change links automatically to affiliate links
  29. Check if user is logged in when clicking certain links on certain pages
  30. Creating login session via CURL
  31. Add htaccess rules with insert_with_markers at beginning of htaccess
  32. Recovering WP Login Credintials in Code?
  33. Woocommerce redirect thankyou page based on product ID doesn’t empty Cart
  34. Wp-login appears White Screen, Error: Cannot modify header information
  35. Two Different Links for Same Product – WooCommerce [closed]
  36. Cannot access wp-admin/wp-login.php (WordPress backend) anymore, what could be wrong?
  37. WordPress homepage infinite redirect
  38. How to debug my custom login form looping intermittently
  39. Redirect undesirable domain
  40. how to combine wordpress htaccess on my root domain + php on subfolder
  41. custom url rewrite for wordpress
  42. Loading index.php contents which located outside blog folder for post single page
  43. Login to wordpress by clicking a link and specifying usernaname and password in url
  44. Should `wp_login` be used since it’s deprecated?
  45. Moving code from theme header to functions.php
  46. Change CSS based on is_user_logged_in
  47. How to display login form anywhere, when user isn’t logged in, without redirecting?
  48. Using a $GET parameter from a URL, to redirect to a URL (WordPress)
  49. Troll the hackers by redirecting them
  50. WordPress redirect redirecting too many times or not at all
  51. I am receiving a pluggable.php warning sign on my only http:// page
  52. How can I add a new row in a separate database when someone registers via WordPress?
  53. Seo Friendly Filter URLs
  54. One account with multiple logins
  55. I installed WordPress locally now how do I login?
  56. Change homepage content if user is logged in – BuddyPress
  57. Is it possible to restrict files from your wordpress uploads (not logged-in users or guest)?
  58. Show login greeting above sub-menu links?
  59. is_user_logged_in returning nothing on custom page
  60. WordPress permalink issue
  61. Removing “There is no account with that username or email address.” error message in “/wp-login.php?action=lostpassword”
  62. Can’t log in to WordPress wp-admin after adding code to functions.php
  63. 404 on old link after changing post url
  64. WordPress url By country code?
  65. Check if user had autologin & if so, logout
  66. Admin Panel 404 Error after login
  67. How to block specific user id in custom login form?
  68. Implementing a multilingual WordPress site by installing several instances of WordPress and redirecting
  69. Pages from admin dasboard missing after site migration
  70. Call WP Rest-Api to GET /users/me returned NOTHING in console
  71. Remove all feeds and return custom 404 page
  72. Internal Server Errors – Moving working multi-site install to my localhost
  73. Menu not updating for logged in users after redirect
  74. how to use auth_redirect() redirect visitor to login page if they are not login when they click account and order page?
  75. Redirect User when they click Menu Option
  76. Change Login or Logout text based on status
  77. Redirecting the lost password page request when using a custon login page
  78. How do I send a POST request with params with WordPress REST API
  79. Deny php execution in /wp-includes – using .htaccess in /wp-includes VS root folder
  80. How come there is no error if I upgrade WordPress core after locking .htaccess permissions to 644?
  81. ERR_TOO_MANY_REDIRECTS / To Force SSL Logins and SSL Admin Access
  82. How to change query string with pretty URL in WordPress using .htaccess file
  83. Upload images from one server to an other in wordpress
  84. Override 404 when navigating to single php file
  85. How can I add “.html” to the end of a single URL on a WordPress website?
  86. Adding a sidebar to wp-login.php
  87. Rewrite /keyword1+keyword2.html to search page | .htaccess
  88. Submitting my form to the database and then redirecting to payment site
  89. add bootstrap modal after login in wordpress
  90. Why I can download any file except PHP files from a URL but I can download any from another site?
  91. Get permalink for a post from inside WordPress and route to a related site
  92. Link to external page has wordpress blog-url inside
  93. Check user last login date
  94. How to create a WordPress PAGE in another folder?
  95. How to change wp-admin and wp-login urls
  96. How do I do so that people can register on my wordpress site?
  97. I can’t log into my website , it says “Error: Cookies are blocked due to unexpected output”
  98. change div text and link for logged in users
  99. Redirect WordPress page to the latest created post by the logged in author/user
  100. Can’t programmatically log user in php
Categories PHP Tags .htaccess, login, php, redirect
Custom fields in the billing address section woocommerce
Media manager asks for file title when upload

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