> For the complete documentation index, see [llms.txt](https://yeken.gitbook.io/snippet-shortcodes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yeken.gitbook.io/snippet-shortcodes/features/interactive-blocks/limit-to-user-roles.md).

# Limit to User Roles

## Limit to User Roles

#### Introduction

By default, a custom shortcode is visible to every visitor. Role/login-status targeting lets you restrict a shortcode so it only renders for guests (visitors who aren't logged in) or for specific WordPress user roles.

#### How to enable

When creating or editing a shortcode, you'll see a section called "Show only to". Tick "Guests (not logged in)" and/or any of the WordPress roles on your site. Leave everything unticked to show the shortcode to everyone - this is the default and matches how shortcodes worked before this option was added.

If you tick both "Guests" and one or more roles, the shortcode is shown to guests **or** to logged-in users with any of the ticked roles.
