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?
- Editor can create any new user except administrator
- WordPress as a CMS Membership website
- Exclude pages from WordPress search result page
- Is there a way to localize role labels?
- BuddyPress | Check if user is in current group [closed]
- Custom Roll/Custom Post Type – Can’t Select Categories
- WordPress roles – Protect administrator role
- Identical members roles on all sites in a multisite
- 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
- Front End Plugin for User Management [closed]
- Coupon codes and wordress; Membership plugin, tertiary plugin or shopping cart? [closed]
- How to get membership level for specific user email
- Member plugin – register approval, restrict downloads, members only pages
- Removing all trace of member profiles
- 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 send s2member plugin’s wordpress user data in json format to a url in php [closed]
- Plugin Development for registered users
- Add additional ‘description’ field for defined roles / role metadata?
- Addin plugin custom post type to members plugin
- I have 2 plugins using the same wp_login action hook and one is not working
- BP Profile search results won’t link to user’s profile page [closed]
- Strange behaviour of is_user_logged_in() and get_current_user_id()
- Sort posts in loop by the WooCommerce Membership of the author
- Display count of new members registered today [closed]
- Downloadable content only for subscribers?
- WordPress User Post Products
- Advice on redirect to lock site from unauthorized users
- Make new users automatically approved
- Creating a folder structure
- Which Membership Plugins Allow Registered Users To Bookmark Posts? [closed]
- WordPress Membership Plugin Advice [closed]
- How to setup a membership system in WordPress?
- Filter Content on Ultimate Membership plugin based on the Country Field Form
- Create relationship between custom post types and users
- Create Member who can’t be changed
- generate PDF from member information
- Allow a page to be edited by a specific custom role
- Update membership level via API request if using simple membership plugin
- How to use plugin’s shortcode in custom design? [closed]
- Members-only page, but accessible via sharable link
- Admin Access for specific page(s)
- Dynamically Modify s2member Options
- Custom User Role: Can Edit Own Page, Cannot Create New
- I keep getting fake users registrations
- Member Site – Always Sends Me Back To Login
- Members only Passthrough
- How do I remove an action hook by s2member
- Memberpress isn’t cooperating with WooCommerce
- What is the best way to build a network of WP sites that share the same membership area?
- IPN for s2member
- Advice on setting up private site
- WordPress/BuddyPress plugin to allow users to create members-only posts [closed]
- how to implement club post type
- Permissions question [closed]
- How to block external download link access if visitor not referred from WP?
- Managing users / external login
- Masking external links with internal link for member-only
- s2member captcha how to make responsive – css or javascript
- What is meaning of BEFORE and AFTER in this hook name?
- Need help with restricted page for users
- registration plugin [closed]
- Username character requirements
- wordpress member