Content Restrictions Shortcodes

The content restriction shortcodes allow you to restrict access to content on your website pages/posts. The content can be restricted as a whole or you can also restrict parts of your content.

To restrict content on your site, open up the shortcodes editor and select one of the options from the "Restrictions" menu.

A window ( displayed into the screenshot above ) will appear, displaying all the available parameters.

It is recommended that you always use the shortcodes editor to add shortcodes to your pages/posts. In this way you're sure your shortcode has been added with the correct parameters configuration.

Restrict to logged in users only

This shortcode is extremely easy to use and requires no further configuration. To hide your content simply wrap your content within the shortcode.

Example usage:

[wpum_restrict_logged_in] add the content you wish to restrict here [/wpum_restrict_logged_in]

Restrict to specific users only

This shortcode allows you to restrict content to specific users only. It means that only the users specified will have access to the content.

Example usage

[wpum_restrict_to_users ids="1, 55, 80"] content here [/wpum_restrict_to_users]

Separate each user id with a comma like in the screenshot here:

Restrict specific user roles only

This shortcode allows you to restrict content to specific user roles only. It means that only the specified user roles will have access to the content.

[wpum_restrict_to_user_roles roles="subscriber, administrator"] content here [/wpum_restrict_to_user_roles]

Note: the roles parameter above accepts only user roles names NOT the titles.

Here's a list of the default user roles names ( NOT TITLES ) that come with WordPress

  • administrator

  • editor

  • author

  • contributor

  • subscriber