With WordPress shortcodes, you can decide exactly what members see. Use them to protect exclusive content and enhance your membership offering.
Memberful’s WordPress plugin allows you to restrict access to an entire post or page through its Restrict Access meta box. If you want to protect certain parts of the content in a post or page, you can use our shortcodes instead.In this help article, you’ll learn how to use Memberful’s shortcodes in your WordPress posts and pages, and learn about the different types of shortcodes available.
This article shows all our shortcodes. The Memberful button in the classic WordPress editor (not available in the new Gutenberg block editor) allows you to add the most common shortcodes to any page or post. Some other shortcodes can only be added manually.The Memberful button allows you to pre-populate shortcodes with the correct slugs for your plans, downloads, and podcasts, so this is the recommended way to add them to your posts and pages.
We recommend using Memberful’s Restrict Access meta box to restrict access to content. However, if you only want to protect certain parts of the content in a post or page, you can use shortcodes.You’ll first need to fetch the integration slug from your Memberful dashboard. The slug for a plan is shown inside the summary box on the right side of the screen when editing that plan.
The slug for a download is shown at the bottom of the page when editing that download.
Renaming a plan or a download will modify its slug, but the old slug will continue to work in WordPress shortcodes. Feel free to rename your plans and downloads anytime, knowing that your existing shortcodes will not break.
Here’s a basic example of requiring a subscription to the Big Awesome plan to see the protected content:
Show content to customers who haven’t yet purchased
If you want to show potential customers a message encouraging them to subscribe to a plan, use the does_not_have_subscription_to shortcode:
Copy
[memberful does_not_have_subscription_to="154-big-awesome"] Shown to users who haven't purchased the "Big Awesome" subscription.[/memberful]
Or for a download, use does_not_have_download:
Copy
[memberful does_not_have_download="27-super-rad"] Shown to users who haven't purchased the "Super Rad" download.[/memberful]
You can also show content to those that don’t have a subscription to any plan:
Copy
[memberful_if_does_not_have_active_subscription] This will only be visible to users that don't have any subscriptions.[/memberful_if_does_not_have_active_subscription]
If you want to specify multiple subscription plans or downloads, use a comma separated list.The following shortcode will show content if the customer is subscribed to any of the plans you specify:
Copy
[memberful has_subscription_to="154-big-awesome,277-cool-hair"] This will only be visible to members who have either the "Big Awesome" subscription, or the "Cool Hair" subscription.[/memberful]
The following shortcode will show content if the customer owns any of the downloads you specify:
Copy
[memberful has_download="27-super-rad,59-rock-on"] This will only be visible to members who have purchased either the "Super Rad" download, or the "Rock On" download.[/memberful]
The following shortcode will show content if the customer is not subscribed to any of the plans you specify:
Copy
[memberful does_not_have_subscription_to="154-big-awesome,277-cool-hair"] This will only be visible to members who are neither subscribed to the "Big Awesome" plan nor the "Cool Hair" plan.[/memberful]
The following shortcode will show content if the customer does not own any of the downloads you specify:
Copy
[memberful does_not_have_download="27-super-rad,59-rock-on"]This will only be visible to members who have neither purchased the "Super Rad" download nor the "Rock On" download.[/memberful]