Restrict Posts/Pages/Custom Post Types
WooCommerce Membership Made Easy allows you to restrict entire post/page/custom post type and redirect restricted users to a custom page with restriction message. You can restrict posts for guests, members, specific user roles, specific users and membership levels.
Content of restricted posts/pages will be hidden from Category, Tag, Taxonomy, Archive, Author pages as well as RSS feeds. Simple restriction message will be displayed for restricted posts on these pages.
Let’s see how we can enable restrictions from post/page create or edit screens.
Using Restriction Settings
You can go to Posts -> Add New or Pages -> Add New to see the available restriction settings. Meta box with restriction settings will be displayed under the post/page editor as shown in the following screenshot.
These settings are also available for any Custom Post Type created from any third party plugin.
First, you have to select the Visibility of the post/page. By default, its visible to everyone viewing your site. You have 5 other options called Guests, Members, Selected Users, Selected User Roles and Selected Memberships.
- Guests – Allows you to make the post/page visible only to guest users who doesn’t have a user account.
- Members – Allows you to make the post/page visible only to members who have a user account and logged into the site.
- Selected User Roles – Allows you to make post/page visible only to the selected user roles
- Selected Users – Allows you to make post/page visible only to the selected users
- Selected Memberships – Allows you to make post/page visible only to the users with an active selected membership
If you choose Selected User Roles option, you will get another setting called Allowed User Roles as shown in the following screenshot. You cam select the user roles allowed to view this post/page.
If you choose Selected Memberships option, you will get another setting called Allowed Memberships as shown in the following screenshot. You cam select the membership allowed to view this post/page.
If someone is not allowed to access the post/page, they will be redirected to the URL specified for Post/Page Restriction Redirect URL setting as shown in the following screenshot.