Protect LifterLMS Lesson Files
Goal: only logged-in LifterLMS students can open your lesson downloads
LifterLMS handles the courses, memberships, and enrollment. Media Guard protects the files inside them. Same pattern as LearnDash — the two cooperate through WordPress roles or Media Guard Groups.
The bouncer model. Think of Media Guard as a friendly bouncer outside a private club. Your files live in a locked back room only the bouncer can open. When someone asks for a file, the bouncer checks their ID (are they logged in? do they have the right pass?) before opening the door.
Before you start
- LifterLMS is installed and at least one course/membership exists.
- Media Guard is installed.
- Pro is optional — recommended if you want per-course access lists.
The simplest setup (Free)
LifterLMS adds a built-in role called “Student” to anyone who enrolls. You can protect files using just that role:
[mediaguard file="syllabus.pdf" roles="student"]
Every enrolled student now passes the check. Easy and zero glue code.
The catch: all students see all files. If you need different files for different courses, jump to the Pro path below.
The per-course setup (Pro)
Use Media Guard Groups. One group per course or membership tier.
- In Media Guard → File Manager, drag in your lesson files.
- Select them, then Assign to Group… a course-specific group (e.g.
photography-101). - In your LifterLMS lesson content, drop the shortcode:
[mediaguard file="lesson-1-handout.pdf" groups="photography-101"]
Add students to the group when they enroll. Easiest way without code: use Uncanny Automator — its LifterLMS trigger (“user enrolls in course”) feeds straight into a “Add to Media Guard Group” action.
Embedding the file inline
If you want students to read the PDF directly on the lesson page, add embed="yes":
[mediaguard file="lesson-1-handout.pdf" roles="student" embed="yes"]
Test it
- Visit the file URL directly in an Incognito window — you should be denied.
- Log in as a non-student account — still denied.
- Log in as an enrolled student — file opens.
FAQ
Does Media Guard stop students from sharing their login? No — that’s a job for LifterLMS itself (or a session-management plugin). Media Guard only checks is this session a valid student session?
What about LifterLMS Memberships (the tier above courses)? Same pattern — give each membership tier a Group and gate files with groups="...".
Related Pro features
Want more control over LifterLMS lesson downloads?
- Pro Features Tour — Everything Pro unlocks on top of the LifterLMS integration.
- Groups & Users — Tie LifterLMS memberships to access groups in seconds.
- Access Log — Track every student download with timestamps and IPs.