You can create a page template to check if user is loggedin. And if it does then redirect user to website homepage (configurable), otherwise show page content.
This is the simple condition you can use to check if user is loggedin.
<?php
if ( is_user_logged_in() ) {
wp_redirect( home_url( "https://wordpress.stackexchange.com/" ) );
exit;
} else {
the_content();
}
?>
Related Posts:
- Are transients private or public?
- Redirect to login when on private page, and when logged in to specific page
- Restrict WordPress to Private
- Change Visibility to Private
- How do I get next_posts_link to work with private posts?
- Private pdf files
- Exclude post from home page and archives, but still public
- Cannot see private content
- How to block access to Crawlers to any Image on a Private page
- Assign a username and password to specific users
- Administrator cannot see private content
- Is there a way to load pages/site from specific referring source only?
- Does Python have “private” variables in classes?
- What is the use of a private static variable in Java?
- C++ classes (public, private, and protected)
- Where to securely store API keys and passwords in WordPress?
- simple solution for restricting access to (some) uploads/downloads
- How do I require authorization / login to view a specific set of posts / pages?
- How do I remove unwanted pages like archive, search, etc.?
- How can I make it so the Add New Post page has Visibility set to Private by default?
- Set posts of a custom post type to be private by default?
- Let private posts stay in status “private” after edit through “editors”
- Fetching private posts or custom post types via WP-API with basic authentication
- Exclude Private, Draft pages from Primary Nav when using custom menu
- Using a private method as an action callback from within a class
- How can I create a separate blog that is private?
- get_terms(); show private posts when logged in
- Attach a private function at a hook?
- WordPress i18n-friendly preg_replace post title
- Restricting access to files within a specific folder [duplicate]
- How to keep track of user logins?
- Private pages that work when you are not logged into WP admin
- Prevent private post 404
- Make post password required to publish
- Disable comments from showing up public for Custom Post Type
- Making a Custom Post type only visible to non-users via a specific link
- Best way to have an per-user customized private section
- Planned private posts get published immediately
- Hide a template part when page is password protected?
- Show a special message for private page?
- What differences are there between a Privately Published post and a Draft post?
- How to create a plugin that notifies for updates?
- How do i make my wordpress website private?
- Can we have private drafts?
- Comprehensively Restrict Post Type Taxonomy to Logged-in Users
- Private Posts/Pages & Search
- How to make a secure blog that is completely private?
- View Private Published Page with URL Code (no login required)
- Private page protected with username and password
- Are private posts visible to search engines?
- The best way to protect uploaded media in WordPress?
- Is user listing on wordpress private?
- How do I display content to users who are not logged in instead of 404 on Private custom posts?
- Whitelist Author of Private Post
- List all private pages user has access rights to read
- Show certain posts in a LIST format that members have been granted access to
- Can’t locate a hidden private page
- How to update the counter of private pages in the dashboard?
- Clean private data (passwords, ftp, database) before zipping my site and SQL and give it to other person
- Setup private content for specific users with daily updates [closed]
- Post visibility based on user role
- How can i realize a semi-private research diary blog
- WordPress tax_query not showing private posts
- Allowing users to view private posts (pending approval)
- Excluding private/protected posts via IP
- read_private_pages capability not working for new role
- How to properly print a 404 error without redirecton? (i.e. keeping the current URL)
- Manage Private Posts
- How to make comments private for commentor and post author
- Accessing private posts through REST API, same code that works in remote doesn’t in local
- Custom post type permalink returns 404 when set to private
- Private Post BUT Public excerpt on Homepage
- Have custom post type Visibility be private by default, and have radio button also set to “Private”
- How can I create an RSS feed that includes “Private” posts?
- Need to block user role from accessing bbPress all together
- Easiest way to have closed comments on a custom post type
- Show private pages in public when you logged in as admin?
- Custom Role read_private_posts Not Working
- How to hide a page in wordpress made for menu
- How to set a Post’s default visibility to ‘Private’ in Gutenberg?
- Check the stored / cached WP_Query with transients on post change
- Forcing two or more custom post type to be private
- How to remove private posts from RSS feeds?
- Code correction – Hide a profile from visitors with a specific role
- Custom get_the_password_form
- How to check if the user was redirected?
- Automatic updates of plugins and themes outside of wordpress.org
- Front end login and page restriction
- Simplest way to create two private sections each with a common account
- Override private status – Enable users to read private posts
- Privacy in WordPress
- Advice on setting up private site
- WordPressMu network with private sites
- AJAX requests within templates
- Step by Step Instructions for Making Media/Uploads Private to Only Logged-In Users
- Exceeded the virtual memory limit
- What is the best way to achieve unique Member functionality?
- Making a private post visitable by link?
- How can I incldue a “private” post type in a loop for public users?
- Wp private content show me files attachments into post