Apps Ballance Cash_2 Chat Checkout Click Code Cog_Wheels Compose_email Conference Contacts Earth Edit_File_1_ Email Email_2 File Folder_2 Gift Group Group_2 Help ID ID_2 Key Keys Laptop_Store Like_1_ Link Lock Log_Out Map Marketing Mobile_UI Navigation POS Partnership Profile Safe_2 Search_User Secure_Files Settings Share Shield Shield_2 Shopping_Cart Support_Male Trash Type_pin User_female User_male logo copy

Restricting content to group members

Iain Poulson avatar
Iain Poulson Last updated on October 7, 2026

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.

WP User Manager logo

Get Started with the Best WordPress Membership Plugin Today

Connect, Manage and Build your Membership Site

Need more help?

If you still didn't find an answer you can always contact us

Submit a ticket