You can put this on your in your home page template or in your header.php (if you want to use across your entire site).
<?php
if ( !is_user_logged_in() ) {
auth_redirect();
}
?>
Details in the WordPress codex… https://codex.wordpress.org/Function_Reference/auth_redirect
Related Posts:
- WordPress Plugins vs Traditional PHP membership website [closed]
- Let users register and show them a members only area (without plugin)
- Which membership plugin for a simple sign in? Personal areas for customers
- Public WP website with one area just for members
- Step by Step Instructions for Making Media/Uploads Private to Only Logged-In Users
- Membership Plugin [closed]
- Paid member plugin with some specific features [closed]
- Compare post levels and user levels wishlist member
- Allow access on a page to just only a specific member
- Private member page
- WordPress membership site for a sports club
- Team club with CPTs and user registration + user dashboard
- I’m looking to add membership to my site, any plugins that would be compatible [closed]
- IF user is logged in only show certain page
- Showing content to specific BuddyPress Member Types
- Enabling Cache on WP Membership Sites. Good OR Bad?
- How can I create a custom dashboard for a membership website?
- Reading additional fields in PMPro
- Custom fields not showing up in the user info (PaidMembershipsPro)
- Any tips for a plugin to define specific pages navigation for specific types of users / members? [closed]
- My account staying logged when the browser closed
- How does a WooCommerce site integrate with the existing real world customer members?
- Membership and search criteria
- how to handle premium features in a wordpress plugin?
- grant multiple roles access to specific admin menu item
- How to mask external download links to be only accessible by logged-in users?
- What permissions does a role need for the user to be assigned as the author of a post?
- New User Sessions in WordPress?
- Premium Members Section of website
- How to get membership level id f a particular user [closed]
- Not for profit membership site on WordPress
- What is the best way to achieve unique Member functionality?
- Check if something is (not) in a list in Python
- Editor can create any new user except administrator
- Remove Ability for Other Users to View Administrator in User List?
- How many users can WordPress handle?
- WordPress as a CMS Membership website
- Membership / subscription plugins – alternatives [closed]
- Exclude pages from WordPress search result page
- Making a client area in WordPress – Any good tutorials or plugins?
- Remove admin bar for subscribers
- Stop users from logging in from multiple locations
- Limit users to one active subscription in WooCommerce Subscriptions? [closed]
- Is there a way to localize role labels?
- Shared Members between two different wordpress installations with different databases
- Members Only site with Feed Keys
- Hiding posts from non logged in users
- BuddyPress | Check if user is in current group [closed]
- Allowing members to upload photos to their profile
- Add new password rule to Ultimate Member register form
- How to Make a Custom Dashboard Widget to Display Custom Notification from Admin?
- How can I only show certain posts?
- Photo gallery on profile page? [closed]
- Having an add_action( ‘user_new_form’,) [closed]
- How to create a Full RSS feed (secret URL) for certain users, short for the rest [closed]
- Adding multiple user roles dynamically
- Is there any way to access Ultimate Member’s custom fields?
- Custom Roll/Custom Post Type – Can’t Select Categories
- WordPress roles – Protect administrator role
- Identical members roles on all sites in a multisite
- Conditional Tags for Membership Levels when using Wishlist Member Plugin?
- Members area with externally-managed htaccess / htpasswd authentication?
- woocommerce and is_user_logged_in() if not redirect to homepage
- Recommend plugins for member’s only e-commerce website [closed]
- WordPress SSO with MemberPress
- How do I perform a “get” call to an external API, and then display the JSON results on a page in my WordPress site?
- advance membership managment
- Capabilites not working [closed]
- How to handle is_user_logged_in() with w3 total cache [closed]
- “Members only” section of a WordPress site – self signup and no backend access
- How can I allow access to multiple users, using the same login, at the same time?
- How to structure sales of reports [closed]
- Front End Plugin for User Management [closed]
- Coupon codes and wordress; Membership plugin, tertiary plugin or shopping cart? [closed]
- BBPress private topics by default
- Password protect the site (without htaccess or membership)
- Restrict post to user_id
- How do you add customer capability after Woocommerce purchase?
- How can I capture Memberpress user info after signup [closed]
- How to get membership level for specific user email
- Membership subscription, change user role when subscription runs out
- Correct method of redirecting user login
- Member plugin – register approval, restrict downloads, members only pages
- Removing all trace of member profiles
- Redirect user to a form until they have filled it out [closed]
- User registration
- Change url links on members loops in buddypress
- Facebook login for private group members
- How can I allow an User to publish only 5 posts per month?
- How to create restrict content to users (by user, not by role)
- How to send s2member plugin’s wordpress user data in json format to a url in php [closed]
- Plugin Development for registered users
- Using Wishlist Member and I need to access a user’s status
- How to get membershiplevel from WordPress Database?
- Add additional ‘description’ field for defined roles / role metadata?
- OAuth 2 and saving the authenticated user
- Stop the execution of foreach loop which extract data from array?
- Addin plugin custom post type to members plugin
- I have 2 plugins using the same wp_login action hook and one is not working
- Conditional menu for registerd users/guests (Genesis framework)