LearnPress – Restrict Posts or Pages for Students Enrolled in a Specific Course

In this tutorial, we’ll show you how to easily restrict posts or pages for students enrolled in a specific course in your LearnPress platform.

This is really important and can be useful when, for example, you write a series of posts that will be like the “textbook” of your online course. In that case, you don’t need your students only to access the blog posts.

Also, if you’ve created landing pages or any other kind of example page exclusively for students, you need to make these pages accessible to the students only.

How can you restrict posts or pages for enrolled students in a specific LearnPress course?

  1. You can program program the restriction from scratch.
  2. You can hire an experience programmer.
  3. You can do it by yourself using the WordPress Conditional Post Restrictions plugin.

This plugin allows you to create conditional restrictions for your posts, pages, courses, downloads, events, products, forums, and any other custom post type in WordPress. You don’t have to program anything nor hire any programmer.

Just follow these simple steps to restrict posts or pages for users enrolled in a specific course in your LearnPress platform.

1- Install the “WordPress Conditional Post Restrictions” plugin

This tutorial assumes you already have installed and activated the LearnPress plugin, and that you already have created the courses you’ll restrict.

You can download the plugin here:

Download WordPress Conditional Post Restrictions Plugin - or - Read more

Once you install and activate the WordPress Conditional Post Restrictions plugin, you can proceed to restrict posts or pages for students enrolled in a specific course.

2- Restrict posts for students enrolled in a specific LearnPress course

Let’s see how to restrict individual posts in a specific LearnPress course. This means you’ll first restrict one post, and then another one, and so on. It’s great if you have some posts to restrict only.

You need to follow these simple steps:

  1. Go to Posts in wp-admin to open the list of your posts.
  2. Open a post you want to restrict for students enrolled in a specific course.
  3. Scroll down to the Restriction Rules section in the post editor.

Once you’ve opened the post you want to restrict and have scrolled down to the Restriction Rules section, you need to select the following values to restrict this post for students enrolled in a specific LearnPress course:

  • Enable conditional restrictions: Yes
  • What happens when the conditions are met: Allow access
  • Condition 1: User is enrolled to course = WordPress course
  • Update the post to save the changes.

This is how you can restrict specific posts for students enrolled in a specific course.

Important

  • You decide which course you want to use as the conditional restriction for your posts. In this example, we’ve used a course called WordPress Course, but the dropdown will show your courses.
  • Remember that you need to repeat the same steps for each post you want to restrict.

3- How to restrict an entire category of posts for students enrolled in a specific LearnPress course

If you don’t want to restrict individual posts and instead want to restrict an entire category of WordPress posts, you can easily do it with WordPress Conditional Post Restrictions.

You just need to follow these simple steps to restrict an entire category of posts for students enrolled in a specific LearnPress course:

  1. Go to Posts > Categories in wp-admin.
  2. Open a specific category you want to restrict.

Once you’ve opened the category of posts you want to restrict, you need to select the following values:

  • Enable the conditional restrictions: Yes
  • Apply restrictions to: Category and posts
  • What happens when the conditions are met: Allow access
  • Condition 1: User is enrolled to course = WordPress Course
  • Update the category.

This is how you can restrict an entire posts category for users enrolled in a specific LearnPress course.

Important

  • You decide which course you want to use as the conditional restriction for your posts category. In this example, we’ve used a course called WordPress Course, but the dropdown will show your courses.

4- How to restrict pages for students enrolled in a specific LearnPress course

Besides posts, you can restrict pages for students in a specific course. You just need to follow some simple steps:

  1. Go to Pages in wp-admin.
  2. Open the page you want to restrict.
  3. Scroll down to the Restriction Rules section in the page editor.

Once you’re in the Restriction Rules section, you need to select the following values to restrict pages for students enrolled in a specific LearnPress Course:

  • Enable conditional restrictions: Yes
  • What happens when the conditions are met: Allow access
  • Condition 1: User is enrolled to course = WordPress Course
  • Update the page to save the changes.

Once you apply these values, only the users enrolled in the selected course will have access to the selected page.

Important

  • You decide which course you want to use as the conditional restriction for your page. In this example, we’ve used a course called WordPress Course, but the dropdown will show your courses.

5- What if a user tries to access a restricted post or page?

This is an important question, and WordPress Conditional Post Restrictions allows you to answer in several ways. You have several options to define what happens when a user tries to access a restricted post or page.

  • Go to Settings > Post Restrictions to open the plugin’s global settings.

Once you’re there, you’ll be able to select what happens when the posts and categories are restricted.

Really easy!

With WordPress Conditional Post Restrictions, you have unlimited possibilities to apply conditional restrictions to your WordPress posts, pages, or any other custom post types such as courses, events, downloads, products, etc.

You don’t have to program anything. Just some clicks, and done!

You can download the plugin here:

Download WordPress Conditional Post Restrictions Plugin - or - Read more