Use this:
if ( is_user_logged_in () ) {
if ( is_page ( 'A' ) || is_page ( 'B' ) || is_page ( 'C' ) ) {
wp_safe_redirect( home_url() );
}
// If we don't redirect, then will be in current page. No need to reload this page again.
}
Related Posts:
- Action wp_login_failed not working if only one field is filled out
- Restricting frontend acess based on user role otherwise redirect to login form
- wp_get_referer not working properly after wp_redirect
- Login redirects and query strings
- How can I login as admin after redirect to custom login page
- Redirect wp-login
- Do more action after login successfully
- Hide Author page from others
- Require re-login when logged-in user attempts to access restricted page
- This webpage has a redirect loop issue
- WordPress site login Redirect
- Problem in auto login after registration
- WordPress Redirect After logging
- redirect_to not Including Hashtag from URL
- Login form- no feedback
- Can’t log in: “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”
- SSO / authentication integration with external ‘directory service’
- Preventing session timeout
- Check for correct username on custom login form
- ‘Password field is empty’ error when using autofill in Chrome
- Prevent wp_login_form() from redirecting to wp-admin when there are errors
- How to disable autocomplete on the wp-login.php page
- how to display the wordpress login and register forms on a page?
- How can I add a custom script to footer of login page?
- Is it alright for two people to simultaneously be logged into a WP site as administrator?
- How do I turn off the ability to login?
- Give visitor access to password protected page/post via external script
- WordPress Login Footer URL
- moving server can not login
- Save last login date in global before change it?
- Redirect after login based on user role (custom login page)
- How to get login data (session) outside WordPress?
- password protect individual pages
- Change register form action url
- Can’t access login page after password reset
- Is back-end access not required for an app to post to my blog?
- How to edit comment_reply_link
- Store brute-force IP addresses
- How do I make my site publicly viewable? Everything redirects to wp-admin
- How to create a private login page for admin.?
- WordPress Security – How to block alternative WordPress access
- Protecting WordPress login page
- Different homepage for logged in users
- Redirect Logged In User if page is wp-login.php and $_Get[‘level’] = X
- reset password link redirect to login page
- Correct method of redirecting user login
- Deregister default wp-admin css on login screen only?
- SSO to WP, from a non-wp site on a different domain and server
- Login with serialized password
- is_user_logged_in() not working in Firefox
- Why would the login page reload indefinitely?
- Set Default User Role
- Creating custom login errors
- Lock out all WordPress Administrators except two specific users
- Removing wordpress cookie from non-wordpress site
- Why is wp-login trying to send an email?
- Replacing default display name to login name
- Why does is_user_logged_in() return false after I change user password on the front end?
- How to generate “WP_Error” Object for user login?
- ?login=failed only attached to URL under certain circumstances
- WordPress not logged in locally with correct username and password
- How to redirect home page to another page after login for all user?
- my wp-login page doesn’t load [closed]
- Requiring login for specific pages
- login trouble WordPress can change IDs created by hoster site
- login/logout for only one page
- WordPress registration page template
- Removing “public” user registration without completely turning it off?
- Custom login modal page action
- Disable registration on certain condition
- Temporally disable password to login with empty password?
- Trying to re-direct users to specific page based on an ACF variable
- Login error when username as email different to primary email
- Unable to login my wordpress website
- How do you implement a login feature on a WordPress site?
- Help! ERROR: Cookies are blocked due to unexpected output on attempting to login to resolve an issue with my site
- How to invalidate `password reset key` after being used
- How to log into WordPress admin in MAMP
- Can’t login with any account – No error message shown
- wp login password reset
- Cookies error during first time login attempt
- Hide login page and use wp_login_form on ordinary pages
- Login screen keeps resetting?
- How can I customize the content of the login page?
- WordPress giving error when I log in after trying emergency.php
- Improvements to “limit login attempts” plugin
- Add a required field to Registration
- loging to Admin page not working at all
- Can’t login through wp-login.php on fresh installation
- WordPress Cookies – wp_set_auth_cookie
- Authenticate return value
- Front-end login problem: requires re-authorization when accessing dashboard
- Using wp_login_form passowrd as undefined
- Redirect non-members to about/intro page
- When trying to login if already logged in, form just shakes – error message remains empty
- Handle POST request sent from an external site for login?
- Unable to login after adding ReCaptacha without API key
- How to create an alternative login page that does not use any plugins?
- Entire WordPress content disappears
- Remove login link from Reset Password-screen