In this tutorial, we’ll show you how to restrict posts or pages to course students in Tutor LMS.
This can be very useful when creating a series of posts for students registered for a specific course. For example, you can create a series of short stories for your Spanish course students or a series of Spanish grammar posts. In this case, you do not need to make these posts available to everyone; access should be exclusively for students enrolled in the Spanish Course.
There are at least three ways you can do this. The first is to program that conditional constraint yourself; for this, you need to know a lot about programming and spend a lot of time creating the constraints one by one. The second way is to hire a professional programmer who will surely take his time and charge you just enough for his work. Both have certain disadvantages because they require a lot of time, a lot of knowledge, a lot of money, or all of the options.
The third way is to create this and many more conditional restrictions on your posts, pages, and any custom post type created with any WordPress Plugin. For example, you can apply conditional restrictions to your courses, events, downloads, products, donations, etc.
The WordPress Conditional Post Restrictions plugin allows you to do this easily. You don’t have to program anything nor spend a lot of money every time you create a new conditional restriction.
You can download the plugin here:
Download WordPress Conditional Post Restrictions Plugin - or - Read more
Once you install and activate the plugin, follow these simple steps to restrict posts or pages to course students (users enrolled in a specific Tutor LMS course):
1- How to restrict a post to course students in Tutor LMS
To restrict individual posts for students enrolled in a specific course, you need to follow these simple steps:
- Open the posts list by going to Posts > All Posts in wp-admin.
- Open a post you want to restrict for students enrolled in a specific course.
- Once you’re on the editor, scroll down to the Restriction Rules section.
Now you need to select these values to restrict this post to course students in Tutor LMS:
- Enable conditional restrictions: Yes
- What happens when the conditions are met: Allow access
- Condition 1: User is enrolled to course = Spanish Course (for example)
- Update the post to save the changes.
Once you apply these values, repeat the same steps for the other posts you want to restrict for students enrolled in a specific Tutor LMS course.
2- How to restrict post categories to Tutor LMS course students
If you don’t want to restrict individual posts, you can restrict entire post categories to students enrolled in a specific course. You just need to follow these simple steps:
- Open the list of post categories by going to Posts > Categories.
- Open the category you’ll edit. For example, we’ll edit the Spanish category.
Once you open the category, select these values to restrict the category to students enrolled in a specific course:
- 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 = Spanish Course
- Update the category.
With these simple steps and values, you can restrict an entire category for users enrolled in a specific Tutor LMS course. It’s really simple!
3- How to restrict pages to course students in Tutor LMS
Besides posts and post categories, you can restrict pages to students enrolled in a specific Tutor LMS course. For example, you can create landing pages to which you want to give access to specific course students.
You can do it easily with the WordPress Conditional Post Restrictions plugin by following these simple steps:
- Open the pages list by going to Pages > All Pages in wp-admin.
- Open a page you want to restrict for students enrolled in a specific course.
- Once you’re on the editor, scroll down to the Restriction Rules section.
Now just select the following values to restrict this page to students enrolled in a specific Tutor LMS course:
- Enable conditional restrictions: Yes
- What happens when the conditions are met: Allow access
- Condition 1: User is enrolled to course = Spanish Course (for example)
- Update the post to save the changes.
Restricting WordPress pages for students enrolled in a specific course is really simple. You just need to follow these simple steps and repeat for all the pages you want to restrict.
4- What if a user tries to access a page or post that is restricted?
You can easily select what will happen when a user tries to access a page or post that is restricted to him. You can show a message indicating that the post is restricted, redirect the user to another URL, etc.
Open the plugin’s global settings at Settings > Post Restrictions.
Once there, you’ll see these fields and options:
- Enable restrictions: Tick/untick this checkbox to enable/disable the global conditions.
- Don’t apply restrictions for these user roles: You’ll see a list of user roles for which the conditions won’t be applied. By default, we will not apply restrictions for administrators, editors, and any user with the capability edit_others_posts.
- What happens when the post is restricted? You have several options to select what happens when the post is restricted:
- Redirect to URL
- Remove the content and show a message
- Show fragment of the content and show message after fragment
- What happens when a category is restricted? You have several options to select what happens when the post is restricted:
- Show error 404
- Show the normal page without posts
- Show an error message
- Redirect to another URL
- Show the content of another page
Once you select the global settings, just save the changes.
How easy!
As you can see, restricting your posts and pages to students enrolled in a specific Tutor LMS course is really easy. You don’t need to program the conditional restrictions from scratch, nor do you need to spend large amounts of money every time you want to do a conditional restriction.
With the WordPress Conditional Post Restrictions plugin, you can apply this and many other restrictions to your posts, pages, courses, recipes, products, donations, events, etc.
You can download the plugin here:
Download WordPress Conditional Post Restrictions Plugin - or - Read more