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

Advice on redirect to lock site from unauthorized users

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:

  1. Is there any way to rename or hide wp-login.php?
  2. Increase of failed login attempts, brute force attacks? [closed]
  3. How to fake a WordPress login?
  4. Brute force attack?
  5. Stop users from logging in from multiple locations
  6. Receiving “This content cannot be displayed in a frame” error on login page
  7. Websites defaced by uploading script using theme editor
  8. Make wordpress admin failed login attempt return 401
  9. advance membership managment
  10. WordPress login urls
  11. Store brute-force IP addresses
  12. How to create a private login page for admin.?
  13. WordPress Security – How to block alternative WordPress access
  14. Protecting WordPress login page
  15. wp-admin folder, brute force, and password protection
  16. Sniffing wordpress user’s credentials
  17. disable site_url redirect in wp-login.php
  18. Does WordPress (or a plugin) reveal login credentials to admin?
  19. Is wp_login_form secure on a non secure page?
  20. WordPress login security
  21. Why isn’t the login page rate limited by default?
  22. How can I password protect a WordPress site without requiring users to log in?
  23. Input sanitation
  24. How to Prevent Brute Force Attack on WordPress
  25. Where is the php file, that does the checks for login information?
  26. Error on WordPress Login
  27. Access log “POST /wp-login.php HTTP/1.0” 400
  28. force login loophole
  29. I need to find which is the file that checks the DB for correct login (username, password)
  30. Membership Plugin with Facebook integration [closed]
  31. How to create separate login for authors/moderators/subscribers?
  32. How to invalidate `password reset key` after being used
  33. Site is not loading after relogin attempts on SSL
  34. Some crawlers/bots attempting to login with very good guesses. How?
  35. User login without username, only password
  36. Hide wp-login.php but not the widget
  37. How login is possible, if I deny login page via nginx?
  38. Username character requirements
  39. WordPress EC2 Security Practices
  40. In Django, how do I know the currently logged-in user?
  41. Can I programmatically login a user without a password?
  42. Can’t log in: “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”
  43. What’s the easiest way to stop WP from ever logging me out
  44. How to login with email only no username?
  45. How can I redirect user after entering wrong password?
  46. Login page ERROR: Cookies are blocked due to unexpected output
  47. Separate registration and login for different roles
  48. SSO / authentication integration with external ‘directory service’
  49. Preventing session timeout
  50. How reduce wordpress login session timeout time?
  51. How to prefill WordPress registration with social details
  52. Check for correct username on custom login form
  53. Disallow user from editing their own profile information
  54. I can’t access my site via wp-admin
  55. ‘Password field is empty’ error when using autofill in Chrome
  56. Removing username from the ‘wordpress_logged_in’ cookie
  57. How to show ‘login error’ and ‘lost password’ on my template page?
  58. What is $interim_login?
  59. Custom login form
  60. How to prefill the username/password fields on the login page
  61. wp_signon returns user, but the user is not logged in
  62. Adding extra authentication field in login page
  63. Prevent wp_login_form() from redirecting to wp-admin when there are errors
  64. Redirect user using the ‘wp_login_failed’ action hook if the error is ’empty_username’ or ’empty_password’
  65. wp_signon() does not authenticate user guidance needed
  66. What exactly is ReAuth?
  67. What are the differences between wp_users and wp_usermeta tables?
  68. Can someone explain what wp_session_tokens are, and what are they used for?
  69. Login members using web services
  70. Make my wordpress blog remember my login “forever”
  71. How to check in timber if user is loggedin?
  72. How do I change the language of only the login page?
  73. Disable WordPress 3.6 idle logout / login modal window / session expiration
  74. Stop WordPress from logging me out (need to keep me logged in)
  75. Woocommerce registration page [closed]
  76. How to disable autocomplete on the wp-login.php page
  77. Share login data/cookies between multiple installations
  78. Synchronize WordPress user accounts across multiple domains and installations without using WordPress MU
  79. How to pass users back and forth using session data?
  80. How do I change the logo on the login page?
  81. Why does WordPress hide the reset password key from the URL?
  82. Is it possible to sign in with user_email in WordPress?
  83. How to use current_user_can()?
  84. Avoid to load default WP styles in login screen
  85. WordPress registration message
  86. how to display the wordpress login and register forms on a page?
  87. Limiting sessions to one IP at a time
  88. Does wp_logout_url() destroy a session? (Logging out question)
  89. How can I send a welcome email to a user AFTER they login for the first time?
  90. Can not login with correct username and password
  91. Website Visible only to Registered users
  92. How can i increase the login expiration length?
  93. How do I use add_action from a class method?
  94. How to remove the WordPress logo from login and register page?
  95. How can I add a custom script to footer of login page?
  96. Customize wp_new_user_notification_email()
  97. Need to execute a cron job
  98. Masking logout URL
  99. Login email after registration never sent or received
  100. How can I create a separate blog that is private?
Categories login Tags login, membership, security
WordPress hook which triggers on post import
Filtering posts by archive showing all years

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