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
- 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
- Custom menus displaying all pages instead of set pages
- Increment price for Woocommerce Minicart [closed]
- Removing the main link to Jetpack from the menu
- comments_popup_link without echo?
- Can’t filter wp_get_attachment_link
- Add version # to wp_register_style function
- Add custom css file after plugin css with WordPress Child Theme functions.php
- Change is_front_page() to is_page() to display ‘hero’ on entire site?
- Some code is added automatically to my site’s header – what is it?
- Adding function to function.php error 505 [closed]
- How to resize image from import image url?
- Vimeo video play button color function
- User’s Comments Number: Storing it in a meta field for different uses
- Show one post per author and order by custom field
- Text before price on WooCom
- Warning: call_user_func_array() expects parameter 1 to be a valid callback
- Change Post status based on custom field date +1 day
- How to add height and width dimensions automatically to archive descriptions
- How to overwrite image if it already exists – WordPress, Gravity form
- Change TinyMCE undeline outpout
- Loading newest dependency javascript module file in functions.php
- How to store page-{id}.php templates in custom folder
- Setcookie not setting cookies anywhere except admin
- WooCommerce, change “Add to Cart” to “Link to Product”, only for specific categories