The comment by ‘warm_tape’ is correct. Use home_url(), then put a die() after the wp_redirect to ensure that the accessed page will ‘die’ and not interfere with your main page.
Related Posts:
- Is there any way to rename or hide wp-login.php?
- Increase of failed login attempts, brute force attacks? [closed]
- How to fake a WordPress login?
- Brute force attack?
- Stop users from logging in from multiple locations
- Receiving “This content cannot be displayed in a frame” error on login page
- Websites defaced by uploading script using theme editor
- Make wordpress admin failed login attempt return 401
- advance membership managment
- WordPress login urls
- Store brute-force IP addresses
- How to create a private login page for admin.?
- WordPress Security – How to block alternative WordPress access
- Protecting WordPress login page
- wp-admin folder, brute force, and password protection
- Sniffing wordpress user’s credentials
- disable site_url redirect in wp-login.php
- Does WordPress (or a plugin) reveal login credentials to admin?
- Is wp_login_form secure on a non secure page?
- WordPress login security
- Why isn’t the login page rate limited by default?
- How can I password protect a WordPress site without requiring users to log in?
- Input sanitation
- How to Prevent Brute Force Attack on WordPress
- Where is the php file, that does the checks for login information?
- Error on WordPress Login
- Access log “POST /wp-login.php HTTP/1.0” 400
- force login loophole
- I need to find which is the file that checks the DB for correct login (username, password)
- Membership Plugin with Facebook integration [closed]
- How to create separate login for authors/moderators/subscribers?
- How to invalidate `password reset key` after being used
- Site is not loading after relogin attempts on SSL
- Some crawlers/bots attempting to login with very good guesses. How?
- User login without username, only password
- Hide wp-login.php but not the widget
- How login is possible, if I deny login page via nginx?
- Username character requirements
- Custom login form
- Adding extra authentication field in login page
- Customize wp_new_user_notification_email()
- Need to execute a cron job
- Masking logout URL
- Login email after registration never sent or received
- How to keep always logged in development environment
- Add Confirm Password field in wp-login.php Password Reset page
- Gaining Login Access via the Database
- send users logging in from wp-login.php directly to home page of site, rather than dashboard
- User Directory without a Plugin
- User logon by using mobile number [closed]
- Pre checking condition before login
- Custom Connect to Facebook, problem logging in/logging out
- Redirect after empty login username and password
- Change Favicon on Login Screen?
- Admin username and password
- Customizing the WordPress login form
- Login error redirecting to wp-login page
- Custom login message for single post pages only
- Private page protected with username and password
- Replace dash with space in username on login
- Autologin only working the second time
- Why wp_update_user doesn’t update user_activation_key on users with apostrophes in their email?
- Forgot Password/ Password Reset Page does not exist
- WordPress on Apache behind nginx using letsencypt issue with loginizer/limit login attempts
- Auto login between word press subdomain and a .net website
- Custom Login form from WordPress site to non-WordPress site
- WordPress error on log out ‘Not Permitted’ and can’t log out
- How can I change the email sender name from wordpress to (myblogname) on the “lost password” email?
- Changed primary domain and now wordpress login won’t work
- Add logout link when logged in, make it disappear when logged out?
- Forcing frontend login with UI switch
- Sidebar login widget with error print, returns an error
- Login without Password
- Exclude login page from custom maintenance code
- Temporarily locked out … how long is a “short while”?
- How do I limit access to wp-admin to an IP range?
- WordPress Logout Problem [closed]
- “if is logged in” doesn’t work for me [closed]
- One time login on 2 different WordPress sites
- How are all users now set to inactive?
- Unable to login into WordPress 401
- Custom user roles are unable to login
- Recovering log in information
- Log in only by email and no username
- Modify wp-login.php Labels Conditionally Based On Referring URL
- Stop customers and subscribers from login to dashboard
- Locked out of WordPress admin area [closed]
- How to dequeue the default CSS styles on the wp-login.php page?
- confirmation email is send from my local host registration of a user but mail will not display in there email account?
- Server error after log in
- How do I resolve my inability to login to WordPress dashboard? [duplicate]
- Without user loging inner page is disable wordpress [duplicate]
- Registration and Login form
- WordPress and Magento: let WordPress manage user registration and logins?
- Share login status across subdomains without network
- How to change the login URL
- Click on banner to register to the blog
- WordPress – Security Question at Login from User’s Meta Data
- issue with my wp site after login
- How to create a fully functional user registration in WordPress?