By default, all information and/or materials you add to the Materials tab in a LearnDash course is displayed to ALL visitors of your site, even those not enrolled in that course. But what if you want the materials to only be available to enrolled users?
LearnDash doesn’t offer a simple option, setting or checkbox to enable this, but you do have a few options. We’ll cover two common techniques you can use to protect your LearnDash materials.
Place Materials in Lessons Instead
One common solution is to place your materials in the first lesson of your course, instead of adding them to the course itself. Lessons are automatically protected by default, and only accessible to those who have access to the course. So an unenrolled user will never be able to see or access them.
You may want to create a new lesson that is dedicated to materials for the course, or you can include materials in multiple lessons throughout your course. It’s entirely up to you, and how your course is laid out.
Use the
at the end. Update your page and test it out.
When viewing the course page logged in as an admin, you should see the material. If you open the same course page in a private browsing window, or a different browser, not logged in, you will not see it.
The
Shortcode
You can also combine this technique with the
and
shortcodes. All content inside of these shortcodes will only be shown to unenrolled users. So you could say something like this:
[visitor]Materials are only available to enrolled students. Buy this course →[/visitor]
Shortcode
You can also combine this technique with the and
[visitor]Materials are only available to enrolled students. Buy this course →[/visitor]
You can add a link to a product page or membership sign up to encourage visitors to purchase access to the course.
If you have any other tips for protecting LearnDash course materials, we’d love to hear about them over in the forum.