Solutions keyboard_arrow_down keyboard_arrow_up
Our Solutions
Ontraport's solutions work together to give you everything you need to run your business in one centralized, easy-to-use platform.
Resources keyboard_arrow_down keyboard_arrow_up
Resources
Find free content on the latest marketing strategies, using Ontraport in your business, and finding the right software.
Visit the blog
University Pricing Chat
clear
Use shortcodes to show or hide membership site content
Last updated on: April 10, 2023

This article is for those building a membership site using WordPress and PilotPress. If you're using Ontraport Membership Sites, click here. If you're getting started and don't know which to choose, this article will help.

On your membership site, you can create membership levels so that members can access only the pages they’re entitled to view based on their level. If you’d like to go a step further and show certain content within a page to certain membership levels, you can do so using shortcodes.

Shortcodes allow you to easily dictate what information should show on a membership site page without complicated lines of code. You can use shortcodes to show or hide content based on the user’s membership level, tag, or whether the user is recognized by Ontraport. See our shortcode reference page for specific shortcodes for accomplishing different goals.

Add shortcodes in the WordPress page editor

If you have an integrated WordPress site, you can insert shortcodes directly into classic blocks for the pages and posts.

  1. Log in to your WordPress site as an administrator.
  2. Create or edit a page or post and add a classic block.
  3. Insert a shortcode by selecting it from the shortcodes dropdown.
  4. If your code references a membership level or tag, add your values in the space provided between the quotation marks.
    • If need to add multiple tags or levels, separate your values with commas.

To add shortcodes to an Ontraport page

If you created your WordPress membership site pages with Ontraport Pages and added them to your WordPress site via the Ontrapages plugin, you’ll manually add your shortcodes before and after the content you wish to show/hide in the Ontraport Pages editor.

In Ontraport Pages, you can add shortcodes to surround individual blocks you’d like to show to certain members or within blocks to protect partial sections. In this example, we provide steps for the first option.

  1. Add blocks above and below the content you’d like to show. Alternatively, you can add a row or even just a text element before and after.
  1. Insert text elements into the blocks.

  1. Place your shortcode above and below the area you would like to protect.

  1. Add your page to your WordPress site with the Ontrapages plugin.
Related university lessons
Ontraport Pages: The grand tour
In this tour, you’ll get a detailed look at page settings, block settings and how to create a page framework to get the page looking just right.
Building a page
This lesson walks you through how to build an Ontraport page from start to finish.
Page elements
Take a tour of the element palette and settings used to create beautiful and functional web pages for your business.
arrow_drop_down_circle
Divider Text
Related support articles
arrow_forward
Use global blocks on pages
arrow_forward
Create and use PURLs
arrow_forward
Designing for mobile devices
 Pro tips

To test your membership levels and shortcodes, the “PilotPress Admin View As” buttons become available after you save the post or page, and they allow you to view the page as a member with one membership level.

Turn your business on with Ontraport.

arrow_drop_down_circle
Divider Text
This website was designed and built with Ontraport.
About Ontraport
Partners & Integrations
Resources
Getting Started
[bot_catcher]