1. Home
  2. WP User
  3. Shortcode
  4. wp_user_restrict

wp_user_restrict

[wp_user_restrict] your restricted content goes here [/wp_user_restrict]

shortcode for Restrict Content to registered users only. logged in users only access content

To restrict just a section of content within a post or page, you may use above shortcodes

You can also set user role for access content.

You can use role attribute for only access content to selected user role:

Ex. [wp_user_restrict role=’author,editor’] your restricted content goes here [/wp_user_restrict]

Ex. [wp_user_restrict role=’author’] your restricted content goes here [/wp_user_restrict]

Ex. [wp_user_restrict role=’logged_in’] your restricted content goes here [/wp_user_restrict] : logged in users only access content

To restrict an entire post or page, simply select the user role you’d like to restrict the post or page to from the drop down menu added just below the post/page editor.

Was this article helpful to you? Yes No