How to Restrict Content in WordPress to Registered Users?
Do you want to restrict content in WordPress to registered users only?
UserPro Plugin allows you to restrict content in WordPress with its handy feature. You can restrict users to a view a particular page content into your WordPress site.
In this article, we will guide you on how to restrict content.
Restrict content in WordPress
After activation, you need to visit UserPro » Restrict Content »
Setting up Lock entire site feature for All Users in WordPress
Go to Restrict Content » Global Restrict/Lock Settings
There is an option available to lock entire site for guests. Select “Yes”.
Here you can,
– Enter the Page ID that guests will be redirected to if the entire site is locked
– Enter the page ID of pages the guest users can view when all site is locked,
– Other options
- Redirect guests from homepage to custom URL
- Redirect members from homepage to custom URL
Setting up Restricted Content in WordPress To Specific Users Only
Restrict Content » Specific Restrict/Lock Settings
There are two options available to make restricted content available to specific users. You can select from the drop-down menu.
- Only Verified Members
- All Registered Members
After that Enter redirect URL if a whole page is locked/restricted
Restrict users from viewing content using shortcode in WordPress
This shortcode will restrict users from viewing any content entered in between shortcode :
[userpro template=postsbyuser ]
Restrict users from viewing content based on their role for this there is a parameter for the shortcode
You need to use this shortcode :
[userpro template=postsbyuser postsbyuser_type=product]
Setting up Restriction for a particular Page or Post
There are Four options available to restrict the page or post in a particular page to particular roles, members and verified accounts.
- No restriction
- Restricted to All Members
- Restricted to Verified Accounts
- Restricted to User Roles
With this, you are all set to set up content restriction for your WordPress site.
Another article that you might also want to check out is how to create a WordPress member directory
If you have any queries please let me know in the comments below.