If you’re only concerned about login links displayed on your pages, you should be able to modify the URL by hooking the login_url filter. This won’t redirect a user that types http://MYSITE/wp-login.php directly into their browser, but it should affect the login links displayed throughout your site.
This is the example code from the login_url Codex page:
add_filter( 'login_url', 'my_login_page', 10, 2 );
function my_login_page( $login_url, $redirect ) {
return home_url( '/my-login-page/?redirect_to=' . $redirect );
}
Related Posts:
- Masking logout URL
- How do I redirect upon login a specific user based on role?
- Redirect specific page in WordPress for first time visit
- Login Redirect if Logged in from Specific Page
- Page get parameter doesn’t work with is_single() function
- Logout Redirect and also WP-login.php Redirect
- How to redirect Subscribers on login to specific page, when logging in from a Page
- How to request login for user but not for bots
- Template Redirect Function Only Working When Logged In
- Redirecting after login except for a specific page
- wp_enqueue_script was called incorrectly
- Logout/login redirect CSS issue
- How can I tell if I’m on a login page? [duplicate]
- Is it possible to use a forgot password url filter?
- Paged Single Post doesn’t redirect to the main url after Removing Pagination
- Login using the password from protected pages
- Logging in redirects to correct page but shows logged out content until forced refresh
- wordpress custom login successful redirect hook
- Remove default user registration, login and subscriber profiles
- is_user_logged_in not working to redirect only logged out users
- Members only site – still need the lost password page accessible
- Ninja form Redirect depending on text field content [closed]
- How do I redirect all 404 error url to Subcategory url
- How to change login labels
- How can I get my Script to work on the Login page?
- 404 redirect to previous category
- Unable to login using username
- When a user logs in, how can they view the website instead of the admin menu?
- Redirect to another page if the user is logged in when pressing again the login button on menu bar
- WordPress PHP Conflicting User Sessions
- Get User Login Data (date, time… )
- Incorrect redirect after commenting
- Registration Hooks don’t appear to be working
- How i can put $_GET codes in function.php?
- If user is logged-in display/hide something
- Why does get_template_directory_uri() not include “www”, only for enqueued stylesheets?
- Secondary Menu and Logged In Users
- Redirect website domain (including all pages) to external URL after Popup message (few seconds)
- Contact Form 7 If Condition
- Prevent WordPress Automatic Logout
- error at login page in wordpress
- Solved: redirect to another page using functions.php
- Redirect to other page if login
- Add Login/Logout Menu Item to Primary Nav “My Account” Submenu [Woocommerce] [closed]
- How to add array [closed]
- WordPress website keeps loading the maintenance page
- Redirects based on a JSON file
- loginout function customization
- Add Login and logout buttons to top menu bar
- Show errormessages on wrong username/password on custom loginform?
- template_redirect action only firing if logged in
- WordPress login set cookie that survive browser exit (wp_signon function)
- Trying to re-direct users to specific page based on an ACF variable
- This code is supposed to only allow user to be authenticated if accountVerified is equal to 1, but it still allows user to be authenticated otherwise
- Prevent wp_signon redirect on failed login for ajax login
- Redirect to one of two pages after data submitted, depending on the current url
- How to replace ACTION url from original wordpress login form?
- Unable to login after registration
- Allow logged in user to view a Page, else send to login screen and then redirect back to Page
- Wildcard 301 Redirect Using Theme Function
- Competing Login Redirects – Need to be Combined?
- Postback redirect through add_action is not triggered
- Need help with AJAX login to call php in functions.php to handle redirects based on user cap (role)
- Restrict access if logged out except for homepage
- Redirect specific author posts to another url
- Custom download page
- Redirect after login to current URL
- How to create a function to redirect a specified page to another page
- Login functions
- Language switcher for subdomains
- WordPress permanently logging users out
- Allow the access over wp-login.php
- is_user_logged_in() isn’t working
- update_user_option not working as expected
- “Headers already sent” while trying to add a CSS file to my login page?
- Making an under maintenance page (without using plugins)
- Disable Attachment Page Except for Category
- Simple way to make most of my site private
- wp_login_form display no styled form
- How to redirect using a custom wordpress api endpoint after form submission?
- If is_single in functions.php
- WordPress show bad the php hour and date
- How to conditionally add a widget via a hook in functions.php
- Creating a custom wordpress widget and stopping js from running twice(once in active widget once in widget selector)?
- Unescape attribute the_title() on CDATA in RSS feed
- How do I find the code executed when wp_head() is called?
- how to add_filter to non hook function
- Redirect After Login Error
- resizing of thumbnails not working
- How Do I include/Import a Custom Widget from the Parent theme into My Child Theme?
- WordPress Check User Role Function (multiple roles)?
- How Can I add a menu to the theme from withen the function.php file
- Post to category based on email domain, for a post-by-email plugin
- Perform function on publish AND save (not just save)
- Enqueueing scripts selectively & activation where needed
- define css class in functions.php
- file.php not loaded?
- Adding tables to the WordPress Editor
- add_menu_page() with variable function
- How to setup a popup registeration page in wordpress with function.php