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. Change WordPress Multisite Domain to subfolder
  20. Redirect undesirable domain
  21. how to combine wordpress htaccess on my root domain + php on subfolder
  22. getting logged in user info (wp-load.php) from parent directory
  23. subdirectory index.php is not working
  24. custom url rewrite for wordpress
  25. How do I display the main domain for my WordPress install?
  26. Loading index.php contents which located outside blog folder for post single page
  27. Login to wordpress by clicking a link and specifying usernaname and password in url
  28. WP & Server Speed [Teacher Question]
  29. Log in / Log Out Custom Button
  30. WordPress add_rewrite_rules for custom URLs ending in .html
  31. Set Cache-Control header for 301 redirects
  32. Should `wp_login` be used since it’s deprecated?
  33. Moving code from theme header to functions.php
  34. Change CSS based on is_user_logged_in
  35. How to display login form anywhere, when user isn’t logged in, without redirecting?
  36. How can I open up my administrative panel to everyone?
  37. Showing latest post without 301 redirect
  38. Having Issue on Redirecting With Session in WordPress
  39. Using a $GET parameter from a URL, to redirect to a URL (WordPress)
  40. Troll the hackers by redirecting them
  41. WordPress redirect redirecting too many times or not at all
  42. Using Argument from Function to Re-Direct Visitor (WordPress)
  43. I am receiving a pluggable.php warning sign on my only http:// page
  44. How can I add a new row in a separate database when someone registers via WordPress?
  45. Login redirect. Check user meta and redirect accordingly
  46. Where to insert redirect code based on http_referer?
  47. Seo Friendly Filter URLs
  48. Is this a correct usage of ob_start() in my WordPress project?
  49. One account with multiple logins
  50. How to disable all logins except Network login in WordPress Multi site?
  51. Lost in trying to create user database system
  52. Shortcode to log user into current URL
  53. PHP Redirect condition
  54. Removing files programmatically
  55. PHP getting error when trying to access WP-Admin Dashboard
  56. I installed WordPress locally now how do I login?
  57. If user is logged in not working
  58. Change homepage content if user is logged in – BuddyPress
  59. Manually Create PHP Page For A Redirect
  60. Is it possible to restrict files from your wordpress uploads (not logged-in users or guest)?
  61. Simple seo-friendly custom $_GET url rewrite with htaccess
  62. Show login greeting above sub-menu links?
  63. Redirect to current user page upon link click
  64. Ajax URLs without #!, how to prevent falling into single.php on load or reload?
  65. is_user_logged_in returning nothing on custom page
  66. Writing a link cloaking plugin
  67. WordPress permalink issue
  68. WP insert post Redirect after function has executed
  69. Help with accessing wp-admin page and resolving error messages
  70. How to redirect non logged in mobile users to page on same site?
  71. How to define a rule in functions.php that ONLY disables the default wp functionality that undesirably changes ‘&’ to ‘#038;’?
  72. Download file and redirect to page or vice versa
  73. How to make Subdomain work for product_tag?
  74. Add more user roles to a PHP logout redirect function [closed]
  75. How to serve WordPress folder over subdomain?
  76. Removing “There is no account with that username or email address.” error message in “/wp-login.php?action=lostpassword”
  77. Can’t log in to WordPress wp-admin after adding code to functions.php
  78. 404 on old link after changing post url
  79. WordPress url By country code?
  80. Check if user had autologin & if so, logout
  81. how can i redirect dynamic URL in worpress base on ID in htaccess or wp-config or function.php
  82. Admin Panel 404 Error after login
  83. PHP warning – Use of undefined constant ‘FORCE_SSL_LOGIN’ ‘FORCE_SSL_ADMIN’ on wp-config.php
  84. How to block specific user id in custom login form?
  85. Log out without confirmation request (nonce)
  86. Implementing a multilingual WordPress site by installing several instances of WordPress and redirecting
  87. WordPress on Ubuntu – “File not Found” for home.php – Trying to Redirect to Root Folder
  88. Having trouble creating two shortcodes, one for logged in user and one for visitors
  89. Pages from admin dasboard missing after site migration
  90. Call WP Rest-Api to GET /users/me returned NOTHING in console
  91. Remove all feeds and return custom 404 page
  92. Rewrite rule not working, but only when parameter is text
  93. Internal Server Errors – Moving working multi-site install to my localhost
  94. Restrict wordpress access to logged users only
  95. Menu not updating for logged in users after redirect
  96. how to use auth_redirect() redirect visitor to login page if they are not login when they click account and order page?
  97. Issues adding Recaptcha v3 to WordPress Registration
  98. Redirect User when they click Menu Option
  99. Display specific page if user signed in
  100. Change Login or Logout text based on status
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
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 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