There are two ways to keep content for the members of particular groups: a shortcode for part of a page, and the Content Restriction addon for whole posts and pages. Only approved members count: people who are pending approval or invited don’t get access.
Part of a page: the shortcode
Wrap the content in [wpum_restrict_to_user_groups], with the IDs of the groups that can see it:
[wpum_restrict_to_user_groups groups="12,34"]
This is only for members of group 12 or group 34.
[/wpum_restrict_to_user_groups]
Being a member of any one of the listed groups is enough. You’ll find a group’s ID in the URL when you edit it in the dashboard (post.php?post=12).
Everyone else sees “This content is available to members only. Please login or register to view this area.” To show nothing instead, add show_message="no".
In the classic editor, the WPUM shortcode button has a Specific groups only content option that builds the shortcode for you.
Developers can change the message with the wpum_content_restriction_message filter.
Whole posts and pages: the Content Restriction addon
With the Content Restriction addon (paid) active, the restriction settings on posts, pages and custom post types have two more options:
- Restriction by Group Membership: the groups whose members can see the content.
- Group Roles: limit it further to members with a group role (Member, Moderator or Admin). Leave it blank for any role.
Related: Getting started with the Groups addon.
Get Started with the Best WordPress Membership Plugin Today
Connect, Manage and Build your Membership Site