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

Redirect non-members to about/intro page

Open your theme’s headr.php file and add at the top

<?php
if( !is_user_logged_in() ) {
    wp_redirect(get_permalink(123));
    exit;
}
?>

just change 123 to the id of your about page, or replace get_permalink(123) with the about page URL example:

<?php
if( !is_user_logged_in() ) {
    wp_redirect('http://mydomain.com/about');
    exit;
}
?>

Related Posts:

  1. How can I create a separate blog that is private?
  2. custom login page redirect to logged in user profile page
  3. How do I check if a post is private?
  4. Send reset password link to user from custom lost password form
  5. WordPress/Buddypress login theme function [closed]
  6. Private page protected with username and password
  7. Facebook login for private group members
  8. How can I login as admin after redirect to custom login page
  9. Replacing default display name to login name
  10. Simplest way to create two private sections each with a common account
  11. Is there a way to give users the option to log in to their favorite group on login? [closed]
  12. Browser Caching for Logged in Users
  13. In Django, how do I know the currently logged-in user?
  14. Can I programmatically login a user without a password?
  15. Can’t log in: “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”
  16. Is there any way to rename or hide wp-login.php?
  17. How to login with email only no username?
  18. How can I redirect user after entering wrong password?
  19. Increase of failed login attempts, brute force attacks? [closed]
  20. Login page ERROR: Cookies are blocked due to unexpected output
  21. Separate registration and login for different roles
  22. SSO / authentication integration with external ‘directory service’
  23. Preventing session timeout
  24. How reduce wordpress login session timeout time?
  25. How to prefill WordPress registration with social details
  26. Check for correct username on custom login form
  27. Disallow user from editing their own profile information
  28. I can’t access my site via wp-admin
  29. ‘Password field is empty’ error when using autofill in Chrome
  30. Removing username from the ‘wordpress_logged_in’ cookie
  31. How to show ‘login error’ and ‘lost password’ on my template page?
  32. How do I require authorization / login to view a specific set of posts / pages?
  33. What is $interim_login?
  34. Custom login form
  35. How to prefill the username/password fields on the login page
  36. wp_signon returns user, but the user is not logged in
  37. Adding extra authentication field in login page
  38. Prevent wp_login_form() from redirecting to wp-admin when there are errors
  39. Redirect user using the ‘wp_login_failed’ action hook if the error is ’empty_username’ or ’empty_password’
  40. wp_signon() does not authenticate user guidance needed
  41. What exactly is ReAuth?
  42. What are the differences between wp_users and wp_usermeta tables?
  43. Login members using web services
  44. Make my wordpress blog remember my login “forever”
  45. How to check in timber if user is loggedin?
  46. How do I change the language of only the login page?
  47. Disable WordPress 3.6 idle logout / login modal window / session expiration
  48. Stop WordPress from logging me out (need to keep me logged in)
  49. Woocommerce registration page [closed]
  50. How to disable autocomplete on the wp-login.php page
  51. Share login data/cookies between multiple installations
  52. Synchronize WordPress user accounts across multiple domains and installations without using WordPress MU
  53. How to pass users back and forth using session data?
  54. How do I change the logo on the login page?
  55. Why does WordPress hide the reset password key from the URL?
  56. Is it possible to sign in with user_email in WordPress?
  57. How to use current_user_can()?
  58. Avoid to load default WP styles in login screen
  59. WordPress registration message
  60. How to fake a WordPress login?
  61. how to display the wordpress login and register forms on a page?
  62. Does wp_logout_url() destroy a session? (Logging out question)
  63. How can I send a welcome email to a user AFTER they login for the first time?
  64. Can not login with correct username and password
  65. Website Visible only to Registered users
  66. How can i increase the login expiration length?
  67. How to redirect after login, the working way?
  68. How do I use add_action from a class method?
  69. How to remove the WordPress logo from login and register page?
  70. How can I add a custom script to footer of login page?
  71. Brute force attack?
  72. Customize wp_new_user_notification_email()
  73. Need to execute a cron job
  74. Login email after registration never sent or received
  75. How to keep always logged in development environment
  76. Add Confirm Password field in wp-login.php Password Reset page
  77. Integrate recaptcha and wp_signon – what is needed?
  78. Stop users from logging in from multiple locations
  79. I want to disable E-Mail verifcation / activation when a user signs up for my WordPress site
  80. Email address or username used to login in wordpress
  81. Front-end login: Redirect user to the post they had created
  82. Receiving “This content cannot be displayed in a frame” error on login page
  83. My login form does not work
  84. Programmatically log in a wordpress user
  85. Action wp_login_failed not working if only one field is filled out
  86. Getting “Cookies are blocked or not supported by your browser” on login page
  87. What is the purpose of logging out after WordPress upgrade?
  88. Is it alright for two people to simultaneously be logged into a WP site as administrator?
  89. wp-login.php redirecting to HTTPS
  90. Display last login time
  91. How to customise wp-login.php only for users who are setting a password for the first time?
  92. BuddyPress | Check if user is in current group [closed]
  93. Intentionally Force Failed Login WordPress
  94. How do I turn off the ability to login?
  95. Gaining Login Access via the Database
  96. How can I test the login for an expired session?
  97. Give visitor access to password protected page/post via external script
  98. How to keep track of user logins?
  99. What hooks should I use for pre-login and pre-registration actions?
  100. WordPress Login Footer URL
Categories login Tags buddypress, login, members, private
bbpress plugin moderation
Choose User to email when adding a new post?

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
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 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