This shortcode is used to limit the visibility of content sections to users or visitors that do not belong to one or more groups. The shortcode is used to limit the visibility of the content it encloses.
By enclosing content on a page or post etc. within this shortcode’s opening and closing tag, you can hide the content section when the page is viewed by group members.
The group
attribute is required and can be used to indicate one or more comma-separated groups.
Please note that group members who will not see the enclosed content when logged in, will be able to view the content when they are logged out.
Supported attributes:
group
is required and must indicate one or more group names separated by comma – if more than one group is provided, the enclosed content is shown only when the user does not belong to any of the groups
Examples
a) This is based on the Registered group that all user accounts belong to, showing the text only to visitors who are not logged in.
[groups_non_member group="Registered"]
Welcome to our site!
Please consider acquiring a membership to access exclusive content.
[/groups_non_member]
b) Showing content conditionally to non-members of a group:
[groups_non_member group="Gold"]
Members of the Gold group will not see this when logged in.
[/groups_non_member]