Shortcodes

Support Request

If you need help with restrict, submit a support request, and we will get back to you shortly.

Submit a Support Request

The Shortcodes area of Restrict is used to generate the shortcodes which can be then used to restrict the content partially on the page or post.

So, from top to bottom, you will have the following areas:

  • Content available to logged in users – generates the shortcode for restricting part of the content visible to logged in users.
  • Content available to logged out users – generates the shortcode for restricting part of the content visible to logged out users
  • Content available to users with specific role – generates the shortcode for restricting part of the content visible to users with a specific WordPress user role. To generate the shortcode, select a user role you want your content to make available to. All the existing user roles will be listed so you should just click the user roles you want and the shortcode will be automatically generated based on your selection.
  • Content available to users with specific capability – generates the shortcode for restricting part of the content visible to users with specific user capability. Similarly to allowing access to specific user roles, you can select specific user capabilities to which you want to display specific content. The difference is that capabilities won’t be listed but instead, you will need to manually enter the user capability and shortcode will be automatically created based on your entry.

 

Regardless of which of these criteria you elect to use, the usage of the shortcode is the same: simply copy the generated shortcode by clicking Copy button and then paste that shortcode to the page or post where you want to use it. The shortcode itself will be in a format similar to this:

[rsc_restrict_content allowed_to=”role” user_role=”administrator”]Your content here[/rsc_restrict_content]

It is important to understand that this shortcode actually consists of three equally important parts: the first part being [rsc_restrict_content allowed_to=”role” user_role=”administrator”] which is in a way an “opening” part of the shortcode, followed by Your content here which actually the content you will be restricting and lastly the “closing” part of the shortcode [/rsc_restrict_content] which goes at the end of the content you want to restrict. Depending on which criteria you have chosen for restriction, the “opening” part of the shortcode will be different while the “closing” part is the same for each criteria. Of course, in any case, you should replace Your content here with the content your actual content.

 

Custom message

You can also add a custom message for the customers that do not meet the required criteria for the restricted content. So, if you want to display a custom message you should include it as an argument protected_message=”YOUR MESSAGE HERE”. As an example, your shortcode will look something like this then:

[rsc_restrict_content allowed_to=”role” user_role=”administrator” protected_message=”YOUR MESSAGE HERE”]Restricted content goes here[/rsc_restrict_content]

 

Integrations

If you have WooCommerce installed and activated on your website, you will have an option to restrict the content based on WooCommerce specific criteria as described in documentation here.

Similarly, if you’re using Tickera event ticketing plugin on your website, another area will appear here, allowing you to use Tickera specific criteria for content restriction. More about this feature can be found here.

Also, if you’re using Easy Digital Downloads plugin, another area will be available where you will be able to set the Easy Digital Downloads specific criteria. To find out more about this, check our documentation here.