Title: Restrict certain shortcodes
Last modified: June 17, 2020

---

# Restrict certain shortcodes

 *  Resolved [srcasey](https://wordpress.org/support/users/srcasey/)
 * (@srcasey)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/restrict-certain-shortcodes/)
 * I have a page that has shortcodes for GamiPress for Social Media sharing.
 * I need to hide those shortcodes for only Subscribers to the website.
 * My code:
    [restrict …]
 * [gamipress_social_share alignment=”left” twitter=”yes” twitter_pattern=”{title}
   on {site_title}” twitter_count_box=”vertical” twitter_button_size=”medium” facebook
   =”yes” facebook_action=”like” facebook_button_layout=”standard” facebook_button_size
   =”small” facebook_share=”no” google_plus=”yes” google_plus_button_annotation=”
   bubble” google_plus_button_size=”tall” google_plus_button_recommendations=”no”
   linkedin=”no” linkedin_counter=”top” pinterest=”yes” pinterest_thumbnail=”[https://upload.wikimedia.org/wikipedia/commons/0/08/Pinterest-logo.png&#8221](https://upload.wikimedia.org/wikipedia/commons/0/08/Pinterest-logo.png&#8221);
   pinterest_round=”no” pinterest_tall=”no” pinterest_count=”none” pinterest_description
   =”{title} on {site_title}”]
 * [/restrict]
 * However, there seems to be no way to restrict the view of the Social Media sharing
   icons to only subscribers. When I toggle the user level to only Subscribers the
   entire page is hidden instead.
 * I do NOT wish to pay for another advanced plugin for this simple task.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Frestrict-certain-shortcodes%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Ashley](https://wordpress.org/support/users/nosegraze/)
 * (@nosegraze)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/restrict-certain-shortcodes/#post-13003752)
 * Hi [@srcasey](https://wordpress.org/support/users/srcasey/) ,
 * You can use the `[restrict]` shortcode, as you’ve shown above, or you can use
   the meta box settings. You do not need to use both. In fact, for what you’ve 
   described, you’d want to leave the meta box portion unrestricted.
 * So this part: [https://ps.w.org/restrict-content/assets/screenshot-2.png](https://ps.w.org/restrict-content/assets/screenshot-2.png)
   should not have any restrictions added.
 * Then in your shortcode, use `[restrict]` around the content you want to protect.(
   You don’t need the `...` in your code, by the way, so change that to `[restrict]`.
 *  Thread Starter [srcasey](https://wordpress.org/support/users/srcasey/)
 * (@srcasey)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/restrict-certain-shortcodes/#post-13010618)
 * Thank you! Turns out that I was testing it incorrectly but I went ahead and removed
   the “…” also.
 * Thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Restrict certain shortcodes’ is closed to new replies.

 * ![](https://ps.w.org/restrict-content/assets/icon.svg?rev=3529325)
 * [Membership Plugin - Kadence Memberships](https://wordpress.org/plugins/restrict-content/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/restrict-content/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/restrict-content/)
 * [Active Topics](https://wordpress.org/support/plugin/restrict-content/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/restrict-content/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/restrict-content/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [srcasey](https://wordpress.org/support/users/srcasey/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/restrict-certain-shortcodes/#post-13010618)
 * Status: resolved