Looking for an easy way to set up WordPress restrict page access to logged in users functionality? If you run a community site on top of WordPress which allows user registration, you probably need a simple way to control which users can access certain private pages at your WordPress site.
In this tutorial, we’ll show you how to easily restrict page access to logged in users in WordPress using the Profile Builder plugin.
You’ll have everything set-up and ready by following the 3 easy steps in the tutorial below…
Profile Builder: The Easiest WordPress Restrict Page Access to Logged In Users Plugin
The Profile Builder WordPress plugin gives you a simple way to customize all parts of the WordPress login and registration process, including setting up WordPress restrict page access to logged in users functionality.
With this easy-to-use plugin, you can:
- Create a custom login page or custom registration page
- Redirect users after they submit the login form or registration form
- Collect additional user profile information about your users
- Let users manage all their profile information from a simple frontend interface
- Create custom user roles to restrict user access or set up different membership levels
- Integrate with other community plugins, like BuddyPress
And with Profile Builder’s Content Restriction feature, you can restrict page access to logged in users in WordPress.
In addition to restricting access by a user’s logged in status, you can also set up other types of restrictions like…
- WordPress restrict content to specific user OR WordPress restrict page access to certain users.
- WordPress restrict access to page by role.
Profile Builder can help you create your own custom user roles if needed, which lets you create as many roles as needed to properly limit access to your WordPress content.
Below, we’ll show you how to set up WordPress restrict page access to logged in users functionality in just a few steps…
WordPress Restrict Page Access to Logged In Users Tutorial
1. Enable Content Restriction Feature in Profile Builder
To get started, make sure to install and activate the Profile Builder plugin. The content restriction feature is available in both the free and Pro versions of the plugin.
Then, under Profile Builder menu tab, navigate to General Settings and make sure you enable Content Restriction.
2. Set up Custom Restriction Messages
After activating the restrict content feature, you’ll notice a new submenu item appearing under Profile Builder tab, named Content Restriction.
From here, you’ll be able to set up the type of restriction, as well as customize the default restriction messages users will see if they don’t have access to certain content.
You can also choose to display a short preview of the restricted content.
Based on these settings, if a non-logged-in user wants to access the restricted content, he will get a short preview containing the first 20 words or any number set in the settings, similar to the one below.
3. Set Up Content Restriction Rules
After setting up the restriction messages, in your WP admin panel simply navigate to each post, page or custom post type you want to restrict. Below the content editor, you’ll notice a section called “Profile Builder Content Restriction“.
Here, you can set up both WordPress restrict page access to logged in users functionality and WordPress restrict content by role functionality.
- If you want to restrict access to any logged in user, check the box for Logged in Users.
- If you want to restrict access to specific user roles, check the boxes for the roles that you want to grant access.
In the example below, the post content will be available for all our logged in users that have the user role of “Administrator” or “Author” attributed.
Furthermore, if you want to customize the restriction message for this specific page or post, you can type in something different than the default message.
Also, if you want to send your users to another page, you can enable the redirect feature. Inside our post, we will redirect all of the users that don’t have the following roles assigned: Editor, Subscriber, SEO Manager or SEO Editor.
Note: You can replicate the same steps for restricting content based on user role for any other page, post or custom post type on your website.
With the Profile Builder WordPress plugin, it’s easy to set up WordPress restrict page access to logged in users functionality for any logged in user or just certain users with specific user roles.
You can use it in multiple scenarios, from providing members-only content, to restricting access to personal or confidential data, or simply setting a WooCommerce store available to only be available to members.
Get started with Profile Builder by clicking the button below:
And if you want even more flexibility to create private content and premium content at your site, you might benefit from a full WordPress membership plugin. In that case, you should check out the Paid Member Subscriptions plugin.
This plugin builds on the content restriction functionality in Profile Builder and also lets you sell access to your content on a one-time or recurring basis (including tracking the IP addresses of all the people who make a purchase).
You can also integrate Paid Member Subscriptions with Profile Builder to get the best of both worlds.
Are you currently restricting access to parts of your website? Let us know your ideas and methods in doing so in the comments section below.
Subscribe to get early access
to new plugins, discounts and brief updates about what's new with Cozmoslabs!