Show or Hide Content

Overview

Show the right content to the right visitors. The Show or Hide Content module lets you display or hide any block of content based on whether a visitor is logged in or logged out, so members and anonymous visitors each see exactly what’s meant for them.

The Show or Hide Content module adds a simple shortcode to your site that conditionally reveals or conceals whatever content you wrap inside it. It’s especially useful for Open LearnDash course types, where anyone can view the page but you want logged-in members to see extra material, or you want to encourage logged-out visitors to sign up.

Common uses include:

  • Showing bonus content or member-only resources to logged-in users.
  • Presenting a call to action (sign up, log in, enroll) to logged-out visitors.
  • Giving anonymous visitors a taste of a course while keeping the full content reserved for members.

This is a free module included in the Uncanny Toolkit for LearnDash.

Enabling the Module

  1. In your WordPress admin, go to Uncanny Toolkit.
  2. Locate the Show Or Hide Content module.
  3. Click Activate to turn it on.

The module has no additional settings — once it’s active, the shortcode is ready to use anywhere shortcodes are supported.

[Screenshot: Uncanny Toolkit modules screen, the “Show Or Hide Content” module card with its Activate toggle in the on state]

How It Works

Wrap any content in the [uo_show] shortcode and set the for attribute to control who sees it. Visitors who don’t match the condition simply won’t see the wrapped content — it’s removed from the page entirely rather than hidden with CSS.

Shortcode Reference

Shortcode Attribute Accepted Values Description
[uo_show] for loggedin Shows the wrapped content only to logged-in users.
[uo_show] for loggedout Shows the wrapped content only to logged-out (anonymous) visitors.

 

[uo_show] (with a hyphen) works as an alias for [uo_show] if you prefer that spelling.

Usage Examples

Show content only to logged-in users:

[uo_show for='loggedin']
This bonus material is only visible to logged-in members.
[/uo_show]

Show content only to logged-out visitors:

[uo_show for='loggedout']
Create a free account to unlock the full course!
[/uo_show]

You can use both shortcodes on the same page to tailor the experience for each audience:

[uo_show for='loggedin']Welcome back! Continue where you left off below.[/uo_show]
[uo_show for='loggedout']Log in to track your progress.[/uo_show]

 

The content inside [uo_show] is fully processed, so you can nest other shortcodes inside it. For example, you can place a login form or another LearnDash shortcode within a [uo_show for='loggedout'] block.

 

Tips and Recommendations

  • We recommend pairing [uo_show for='loggedout'] with a clear call to action — a sign-up link or login prompt — to convert anonymous visitors into members.
  • The [uo_show] shortcode checks login status only. To show or hide content based on LearnDash enrollment, LearnDash’s own [visitor] and [student] shortcodes work on course pages and filter by enrollment status.
  • Because non-matching content is removed from the page, it won’t appear in the page source — making it a clean way to keep member-only material private.

 

8 thoughts on “Show or Hide Content”

  1. in courses i enable hide course (edit courses) but content is still showing non logged users why?

    content table is showing in given link why?

    1. Hi there, it looks like you were able to get the content table hidden. Regarding the content showing; that’s something you could ask LearnDash, as the setting is built into LearnDash and not related to our plugins. Thanks!

  2. Hello.

    I need at less 2 user catgories: Students 1 and students2.
    May be I can get this done with: Cimy User Extra Fields.

    Then both will take the same curse, but for students 2 I will need the are able to see more lessons.
    In other words, I need hide some lessons to students 1

    Can I use this little script or similar?

    thanks

    1. This should not be done, I’m afraid. You can’t make lessons optional in LearnDash, and if you did hide the lessons then users that didn’t see the lessons could never complete the course and progress wouldn’t be tracked properly. It won’t work; you should use a second course if some users see different lessons.

  3. Is it possible to restrict a whole page depending on a user’s login status? I can already hide menu items based on a user’s logged in status, but is there a way to restrict logged out users from even getting to a page, even if they had the URL? The best solution would be to redirect them to a different page where I can prompt them to log in or get in touch.

    1. It’s not possible with this module, but there are ways of achieving this with other plugins. Many membership plugins allow restrictions on entire pages.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top