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

How To Change Wp Register/Login URL Permanently To My Custom Page

Just customize the login URL with the login_url filter:

https://gist.github.com/tripflex/ac477b59d20bd11c5856edcffc13e5ef

add_filter( 'login_url', 'smyles_custom_login_url', 10, 3 );
/**
 * Filters the login URL.
 *
 * @since 2.8.0
 * @since 4.2.0 The `$force_reauth` parameter was added.
 *
 * @param string $login_url    The login URL. Not HTML-encoded.
 * @param string $redirect     The path to redirect to on login, if supplied.
 * @param bool   $force_reauth Whether to force reauthorization, even if a cookie is present.
 *
 * @return string
 */
function smyles_custom_login_url( $login_url, $redirect, $force_reauth ){
    // This will append /custom-login/ to you main site URL as configured in general settings (ie https://domain.com/custom-login/)
    $login_url = site_url( '/custom-login/', 'login' );
    if ( ! empty( $redirect ) ) {
        $login_url = add_query_arg( 'redirect_to', urlencode( $redirect ), $login_url );
    }
    if ( $force_reauth ) {
        $login_url = add_query_arg( 'reauth', '1', $login_url );
    }
    return $login_url;
}

Related Posts:

  1. Change register form action url
  2. Separate registration and login for different roles
  3. SSO / authentication integration with external ‘directory service’
  4. How to prefill WordPress registration with social details
  5. Woocommerce registration page [closed]
  6. WordPress registration message
  7. How to remove the WordPress logo from login and register page?
  8. Login email after registration never sent or received
  9. I want to disable E-Mail verifcation / activation when a user signs up for my WordPress site
  10. How do I check if a post is private?
  11. Receiving “This content cannot be displayed in a frame” error on login page
  12. How to customise wp-login.php only for users who are setting a password for the first time?
  13. What hooks should I use for pre-login and pre-registration actions?
  14. Problem with logging in WP users automatically
  15. Is it possible a one click user registration with Facebook or Twitter (or other Social Networks)?
  16. Register/Login using only phone number?
  17. Force users to register in order to view website [duplicate]
  18. How do I force “users must be registered and logged in” on subsites?
  19. auto login after registeration for wp-members plugin
  20. How to modify the action attribute of the wp-login.php?action=register form?
  21. Correct passwords keep appearing as incorrect
  22. Disabling standard registration login with username/email and password?
  23. Login form doesn’t log in
  24. Get the url of custom login page in the registration page
  25. By registering always make uppercase the first letter of the login
  26. Show reCaptcha on Custom Frontend Login & Register Form [closed]
  27. Best option to implement external register/login to WP from self-made API
  28. Auto Login After Registration
  29. Disable all other page except index,register,login till user login
  30. Changed Wordress Address URL Accidently
  31. What speaks against using a custom login.php / register.php to wordpress?
  32. How do I add Login fields and registration link to the header?
  33. How to make a user be able to register if such a login already exists?
  34. Sending new registration meta values to admin by email
  35. Are login functions considered part of the WP backend?
  36. WordPress registration page template
  37. Removing “public” user registration without completely turning it off?
  38. Disable registration on certain condition
  39. what is the best and safest way to allow users to register to site
  40. Updated : how to make email optional while user registration using default wordpress form
  41. Problem in auto login after registration
  42. How to invalidate `password reset key` after being used
  43. redirect_to not Including Hashtag from URL
  44. Updating usermeta from login redirect to billing address
  45. Chosen user password in registration is not being accepted on Login
  46. WordPress auto login user after registration only from a specific page
  47. User account activation links are lacking query strings
  48. Login user after registration programmatically
  49. Remember me doesn’t work with www?
  50. How to get rid of the username of registration form in theme my login wp plugin?
  51. Where do I find “log in” and “register” link which are located on the top right corner?
  52. How to force login after user browses for a few minutes or browses a few pages?
  53. Registration and Login form
  54. WordPress and Magento: let WordPress manage user registration and logins?
  55. Trim the repeated value in URL
  56. how to add custom word press regisration form in word press 3.5 with out module [closed]
  57. Click on banner to register to the blog
  58. How to put Login, Register and newsletter widget on the same page?
  59. make a login system for site visitors
  60. How to create a fully functional user registration in WordPress?
  61. Replace the “wp-admin” in the URL with “xyz-admin” in WordPress dashboard
  62. Can’t access wordpress mgt dashboard until propogation finished?
  63. In Django, how do I know the currently logged-in user?
  64. Check if wp-login is current page
  65. Can I programmatically login a user without a password?
  66. Can’t log in: “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”
  67. Is there any way to rename or hide wp-login.php?
  68. How to login with email only no username?
  69. How can I redirect user after entering wrong password?
  70. Increase of failed login attempts, brute force attacks? [closed]
  71. Login page ERROR: Cookies are blocked due to unexpected output
  72. Redirect user to original url after login?
  73. Preventing session timeout
  74. How reduce wordpress login session timeout time?
  75. Check for correct username on custom login form
  76. Disallow user from editing their own profile information
  77. I can’t access my site via wp-admin
  78. ‘Password field is empty’ error when using autofill in Chrome
  79. Removing username from the ‘wordpress_logged_in’ cookie
  80. How to show ‘login error’ and ‘lost password’ on my template page?
  81. What is $interim_login?
  82. How to change “You must be logged in to post a comment.”
  83. Custom login form
  84. How to prefill the username/password fields on the login page
  85. wp_signon returns user, but the user is not logged in
  86. Adding extra authentication field in login page
  87. Prevent wp_login_form() from redirecting to wp-admin when there are errors
  88. Redirect user using the ‘wp_login_failed’ action hook if the error is ’empty_username’ or ’empty_password’
  89. wp_signon() does not authenticate user guidance needed
  90. What exactly is ReAuth?
  91. What are the differences between wp_users and wp_usermeta tables?
  92. WordPress auto login after registration not working
  93. Login members using web services
  94. Make my wordpress blog remember my login “forever”
  95. How to check in timber if user is loggedin?
  96. How do I change the language of only the login page?
  97. Disable WordPress 3.6 idle logout / login modal window / session expiration
  98. Stop WordPress from logging me out (need to keep me logged in)
  99. How to disable autocomplete on the wp-login.php page
  100. Share login data/cookies between multiple installations
Categories login Tags login, urls, user-registration
Best way to tell if a user account is active, using the database only
How to pass arguments to add_action() or retrieve return value of called function?

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