|
/ Knowledge Base /FAQ/ Show or Hide Inline Content Using SureMembers Shortcodes

Show or Hide Inline Content Using SureMembers Shortcodes

The SureMembers shortcode [suremembers_restrict] allows you to show or hide specific sections of a page based on access group membership. This is especially useful when you want to control content visibility inside SureDash, blog posts, or landing pages without locking the entire page.

This guide walks you through how to use the shortcode correctly, how to find the Access Group ID, and how to implement it across different editors like Gutenberg, Elementor, Bricks, and the Classic Editor.

What Does the Shortcode Do?

When placed around a section of content, the shortcode hides that content entirely for users who do not belong to the specified access group. No warning or message is shown. The content simply doesn’t appear.

This gives you full control over what each user sees without any fallback messaging.

Syntax

[suremembers_restrict access_group_ids='452']
 Your protected content goes here.
[/suremembers_restrict]

Replace 452 with the actual Access Group ID you want to target.

Where to Get the Access Group ID

You don’t need to guess or write this manually. Every Access Group includes a copy-paste-ready shortcode.

Example Use Case

Let’s say you want to show bonus content to users who purchased a course:

[suremembers_restrict access_group_ids='752']
<h2>Bonus Lesson: Advanced Tips</h2>
<p>This content is only visible to paid members of the course.</p>
[/suremembers_restrict]

Users who are not part of Access Group 752 will not see anything.

How to Use in Different Editors

Gutenberg (Default Block Editor)

  1. Add a Shortcode block to your page.
  2. Paste your opening shortcode:  [suremembers_restrict access_group_ids='452']
  3. Add your content in a new block underneath (Paragraph, Image, Buttons, etc.).
  4. Add another Shortcode block and paste your closing tag: [/suremembers_restrict]

Elementor

  1. Add a Shortcode widget and paste the opening tag: [suremembers_restrict access_group_ids='452']
  2. Add your content using any Elementor widgets like Heading, Text Editor, Image, or Button.
  3. Add another Shortcode widget and paste the closing tag: [/suremembers_restrict]

Bricks Builder

  1. Add a Shortcode element at the top of the section or container and paste: [suremembers_restrict access_group_ids='452']
  2. Add your content using any Bricks elements (Heading, Text, Image, Video, etc.).
  3. Add another Shortcode element at the bottom of the section and paste: [/suremembers_restrict]

You can also paste the full shortcode and content inline using a Code element if preferred.

Classic Editor

  1. Switch to the Text tab in the editor.
  2. Paste the full shortcode and content like this:
[suremembers_restrict access_group_ids='452']
Your protected content here.
[/suremembers_restrict]

Frequently Asked Questions

Can I add multiple access group IDs in one shortcode?
No. The access_group_ids parameter only supports one ID at a time. If you want to show the same content to multiple groups, you’ll need to duplicate the shortcode block and change the ID in each one.

What happens if I enter the wrong group ID?
If the ID doesn’t match an existing group, the content inside the shortcode won’t be shown to anyone.

Can I show different content to users without access?
There is no not_group option or inverse condition. To show alternative content, place it outside the restricted shortcode and use your layout builder to manually control visibility if needed.

Why doesn’t it show an “Access Restricted” message?
The [suremembers_restrict] shortcode is intentionally silent. It does not display any fallback message when access is denied. If you want to show a custom message to users without access, you’ll need to add it as a separate section.

Does redirection still work when using the shortcode?
No. Redirection rules only apply when an entire page or post is restricted through the Access Group settings. If you’re using the shortcode within a visible page, SureMembers does not redirect users; it simply hides the shortcode content.

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
On this page

Remind me about SureMembers's HUGE Black Friday Sale

Scroll to Top