For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.