Some parts of your articles may include information you would like to show only to members with special privileges.

For example, in our hypothetical membership site, we want to provide expert advice to Premium and VIP members only, which may encourage other visitors to purchase the subscription.

Compare the following images.

What visitors and subscribers will see:
What visitors and subscribers will see:

What Premium and VIP users will see:
What Premium and VIP users will see:

To restrict access to certain parts of your post to users only with specific roles, use the Toolset Access plugin and its conditionally displayed text feature.

  1. Open your post for editing.
  2. Click the “Access” button to insert conditionally -displayed text.

    How to restrict access to certain parts of your post
    How to restrict access to certain parts of your post
  3. In the dialog that opens, select roles for those whom you wish not to view your text. In our example, we want to hide expert advice from Subscribers and Guests.
  4. Enter the text you want to hide from these users.
  5. In the section entitled “Will these roles see the text?” choose “Everyone except these roles will see the text.”

    How to insert conditionally-displayed text
    How to insert conditionally-displayed text

That part of your article can then be accessed by those with the remaining roles.

Your post will look like this:

Restricting access to certain parts of your post with the toolset_access shortcode
Restricting access to certain parts of your post with the toolset_access shortcode

Notice that the text is wrapped with [toolset_access] shortcode using the “deny” operator. You can use the same shortcode with the “allow” operator to specify what these users will see instead.

For example, it can be a message followed by a link to the Buy page.

Restricting access to certain parts of your posts and pages
[toolset_access role="Subscriber,Guest" operator="allow"]
<strong>Premium</strong> or <strong>VIP </strong>membership required to see Expert advice. <a href="#">Choose your plan.</a>
[/toolset_access]

Check our documentation for more details.