LearnPress – Restrict Downloads to Course Students

In this post, we show you how to restrict downloads to students enrolled in a specific LearnPress course (images, ebooks, files, documents, videos, etc.). This is really useful when you create ebooks for users enrolled in a specific course and don’t want other users to have access to this file. In that case, only the users enrolled in the selected course need to have access to the files.

What downloads manager to use?

You can use any downloads manager plugin. For example, we’re using the WordPress Download Manager plugin. This is important because download managers allow you to create files with the Download post type, which we’ll use to restrict the downloads.

How to apply conditional restrictions to my downloads

Normally, you’d have to program that conditional restriction, but you must have considerable programming knowledge. Another way to restrict ebooks for students enrolled in a specific course is by hiring an experienced programmer. In both cases, you’ll need to wait for some time and the conditional restriction will be really limited.

On the other hand, we have the WordPress Conditional Post Restrictions plugin. You can apply restrictions to the following WordPress post types:

  • Posts
  • Pages
  • Courses
  • Downloads
  • Recipes
  • Products
  • Events
  • And any other custom post type generated by any WordPress plugin.

These are some of the restrictions you can apply to any custom post type:

  • IP
  • Post Viewed Count
  • Referer
  • URL
  • User role
  • User email
  • User email company
  • Days since user registration
  • User enrolled in course
  • User courses count
  • Hour of the day
  • Date
  • Day of the week
  • Day of the month
  • Month of the Year
  • Etc.

And the best is that you don’t have to program anything. You just need a few clicks and some simple clicks to apply unlimited conditions to your posts, pages, and custom post types.

Once you install the plugin, follow these simple steps to restrcit ebooks to students enrolled in a specific LearnPress course:

1- Restrict downloads to users enrolled in a LearnPress course

The first thing we’ll show you is how to restrict downloads to users enrolled in a specific course. This is useful when you want to restrict individual files for course students.

Since we’re using the WordPress Download Manager plugin, we need to go to Downloads > All Files.

Once there, let’s open a file we’ll edit. In this example, we’ll restrict the Spanish Grammatical Structures ebook to grant access to the Spanish course students only.

learnpress restrict downloads to course students

Once you open the file, scroll down to the Restriction Rules section on the file editor.

Once there, select the following values to restrict this file for students enrolled in a specific course.

  • Enable content restrictions: Yes
  • What happens when the conditions are met: Allow access
  • Condition 1: User is enrolled to course = Spanish Course (for example).
  • Update the file to save the changes.

learnpress restrict downloads to course students

This is how you can restrict specific, individual files for students enrolled in a specific course. You need to repeat the same steps with all the other files you want to restrict, or you can read the next section to discover how to restrict file categories for users enrolled in a specific LearnPress course.

2- Restrict Download Categories for Users Enrolled in a LearnPress Course

You can restrict an entire category of downloads (files, ebooks, documents) to users enrolled in a specific LearnPress course. For this, you need to open the categories section.

As we’re using the WordPress Download Manager plugin, we need to go to Downloads > Categories in wp-admin.

Once there, we need to open the category we want to edit. In this case, we’ll edit the Spanish Course Files category.

learnpress restrict downloads to course students

After opening the category, go select the following values to restrict this entire category for users enrolled in a specific LearnPress 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.

learnpress restrict downloads to course students

3- What if a user tries to access a restricted ebook or file?

To select what happens if a user tries to access a restricted download, you need to open the plugin’s global settings at Settings > Post Restrictions and select what you want the users to see when they try to access a restricted file. You can redirect users to another URL or show them a message indicating the posts are restricted.

That’s really simple!

We have shown you how to unlock ebooks for students enrolled in a specific LearnPress course. You don’t have to program anything nor hire a professional programmer. You can do it yourself with some simple clicks.

You can apply this and any other conditional restrictions to your posts, pages, and any other custom post type.

Close Menu