> ## Documentation Index
> Fetch the complete documentation index at: https://memberful.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# WordPress shortcodes

> With WordPress shortcodes, you can decide exactly what members see. Use them to protect exclusive content and enhance your membership offering.

export const RelatedDocs = ({link1, link2, link3, link4, link5, link6, link7, link8, link9, link10, className = ""}) => {
  const links = [link1, link2, link3, link4, link5, link6, link7, link8, link9, link10].filter(Boolean);
  if (!links.length) return null;
  return <section className={`related-docs border dark:border-gray-700 rounded-2xl px-6 py-4 mt-6 ${className}`}>
      <p className="mb-2 font-medium">
        <strong>Related help docs:</strong>
      </p>
      <ul className="space-y-1 mb-1 mt-1">
        {links.map((link, index) => <li key={index}>
            <a href={link.url}>{link.label}</a>
          </li>)}
      </ul>
    </section>;
};

Memberful's WordPress plugin allows you to restrict access to an entire post or page through its [Restrict Access meta box](/wordpress-plugin/protect-content/restrict-access-to-a-single-post/#choose-who-has-access). If you want to protect certain *parts* of the content in a post or page, you can use our [shortcodes](http://codex.wordpress.org/Shortcode) instead.

In this help article, we'll cover how to use Memberful's shortcodes in your WordPress posts and pages, and the different types of shortcodes available.

## Access shortcodes via the Memberful editor button

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.

<Frame>
  <img src="https://mintcdn.com/memberful/M_FwlsoTYDRYJ4EU/images/wordpress-plugin/protect-content/wordpress-shortcodes/wordpress-shortcodes.png?fit=max&auto=format&n=M_FwlsoTYDRYJ4EU&q=85&s=0ef5a9c96de9f72044855de2148d9d37" alt="Memberful shortcode button in the WordPress editor" width="1440" height="722" data-path="images/wordpress-plugin/protect-content/wordpress-shortcodes/wordpress-shortcodes.png" />
</Frame>

## Link shortcodes

Link for a member to sign in to their account:

```text theme={null}
[memberful_sign_in_link]Sign in[/memberful_sign_in_link]
```

Link for a member to sign out of their account:

```text theme={null}
[memberful_sign_out_link]Sign out[/memberful_sign_out_link]
```

Link for a member to manage their account:

```text theme={null}
[memberful_account_link]Account[/memberful_account_link]
```

Link to sign up as a free member:

```text theme={null}
[memberful_register_link]Sign up for a free account![/memberful_register_link]
```

Link to buy a plan:

```text theme={null}
[memberful_buy_subscription_link plan=64879-monthly]Buy Monthly plan[/memberful_buy_subscription_link]
```

Link to buy a gift:

```text theme={null}
[memberful_buy_gift_link plan='64879-monthly']Buy the Monthly plan as a gift for someone[/memberful_buy_gift_link]
```

Link to buy a download:

```text theme={null}
[memberful_buy_download_link download='123-my-download-slug']Buy Preset pack 1[/memberful_buy_download_link]
```

Link to a protected download:

```text theme={null}
[memberful_download_link download="123-my-download-slug"]Download Preset pack 1[/memberful_download_link]
```

Link to all the podcasts in the member's account:

```text theme={null}
[memberful_podcasts_link]Access your podcasts[/memberful_podcasts_link]
```

Deep-link to a specific podcast in a member's account:

```text theme={null}
[memberful_podcasts_link podcast=5787]Access the podcast[/memberful_podcasts_link]
```

Display the RSS URL for a member's specific podcast:

```text theme={null}
[memberful_podcast_url podcast=2]
```

Link to a member's [private WordPress RSS feed](/wordpress-plugin/protect-content/private-rss-feeds):

```text theme={null}
[memberful_private_rss_feed_link]Your RSS feed[/memberful_private_rss_feed_link]
```

## Restrict access with shortcodes

We recommend using [Memberful's Restrict Access meta box](/wordpress-plugin/protect-content/restrict-access-to-a-single-post/#choose-who-has-access) 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.

Go to *Revenue → Plans,* then click the **Links** button for the plan you want to use in your shortcode.

<Frame>
  <img src="https://mintcdn.com/memberful/XFXzbLESZUIkqp4W/images/wordpress-plugin/protect-content/wordpress-shortcodes/links.png?fit=max&auto=format&n=XFXzbLESZUIkqp4W&q=85&s=d7d471199f82aee5ac8547ec61bfea79" alt="Links button" width="1440" height="928" data-path="images/wordpress-plugin/protect-content/wordpress-shortcodes/links.png" />
</Frame>

Copy the **Plan ID**.

<Frame>
  <img src="https://mintcdn.com/memberful/3Knn4royFiQaqd1t/images/wordpress-plugin/protect-content/wordpress-shortcodes/copy-plan-id.png?fit=max&auto=format&n=3Knn4royFiQaqd1t&q=85&s=131914d29042cb684e727e888aa2c3ef" alt="Links and shortcodes" width="1440" height="488" data-path="images/wordpress-plugin/protect-content/wordpress-shortcodes/copy-plan-id.png" />
</Frame>

The slug for a download is shown at the bottom of the page when editing that download.

<Frame>
  <img src="https://mintcdn.com/memberful/3Knn4royFiQaqd1t/images/wordpress-plugin/protect-content/wordpress-shortcodes/download-slug-in-download-editor.png?fit=max&auto=format&n=3Knn4royFiQaqd1t&q=85&s=6d27d00d8a309cba73b0c1bbecd26835" alt="Slug for Memberful download" width="1440" height="885" data-path="images/wordpress-plugin/protect-content/wordpress-shortcodes/download-slug-in-download-editor.png" />
</Frame>

<Callout icon="info" color="#22E273">
  Renaming a plan or a download will modify its slug, but the old slug will continue to work in WordPress shortcodes. Rename your plans and downloads anytime, knowing that your existing shortcodes will not break.
</Callout>

Here's a basic example of requiring a subscription to the *Big Awesome* plan to see the protected content:

```text theme={null}
[memberful has_subscription_to="154-big-awesome"]

  Protected content goes here...

[/memberful]
```

Require the *Super Rad* download to see the protected content:

```text theme={null}
[memberful has_download="27-super-rad"]

  Protected content goes here...

[/memberful]
```

Alternatively, you can restrict the content to members that have a subscription to **any** plan:

```text theme={null}
[memberful_if_has_active_subscription]

  This will be visible to members that have a subscription to any plan.

[/memberful_if_has_active_subscription]
```

## Show content to visitors who haven't yet purchased

If you want to show potential members a message encouraging them to subscribe to a plan, use the `does_not_have_subscription_to` shortcode:

```text theme={null}
[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`:

```text theme={null}
[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:

```text theme={null}
[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]
```

## Specify multiple plans or downloads

If you want to specify multiple subscription plans or downloads, use a comma separated list.

The following shortcode will show content if the member is subscribed to **any** of the plans you specify:

```text theme={null}
[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 member owns **any** of the downloads you specify:

```text theme={null}
[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 member is **not** subscribed to any of the plans you specify:

```text theme={null}
[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 member does **not** own any of the downloads you specify:

```text theme={null}
[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]
```

<RelatedDocs
  link1={{
url: "/wordpress-plugin/protect-content/bulk-restrict-access/",
label: "Restrict access to multiple posts in bulk.",
}}
  link2={{
url: "/wordpress-plugin/protect-content/restrict-access-by-category-or-tag/",
label: "Restrict access to entire categories or tags.",
}}
  link3={{
url: "/wordpress-plugin/protect-content/wordpress-functions/",
label: "Restrict elements of your WP theme.",
}}
/>
