LifterLMS Course Tracks: Learning Paths, Prerequisites, Certificates
How LifterLMS course tracks turn separate courses into a learning path: create a track, require it before an advanced course, award a certificate…
Read articleRestricting a lesson does not restrict the files in it. On a default WordPress site, a PDF workbook attached to a members-only lesson lives at a public address in wp-content/uploads. Anyone with the link can download it, and links get shared.
LifterLMS can protect files so that only students enrolled in a chosen course or membership can open them. This guide explains how to protect files in LifterLMS, how the protection works, what the signed download URLs added in version 10.2 are for, and the server checks that decide whether your files are actually safe. It is written for course owners and the developers who look after their sites, and was checked against the LifterLMS 10.3 source.
Media protection is part of the free core plugin. It works on files in your WordPress media library: PDFs, worksheets, slide decks, images, audio and video files you uploaded to your own server.
It does not cover files hosted elsewhere. Videos on Vimeo, Wistia, YouTube or a streaming service, and files in cloud storage such as Amazon S3, are protected (or not) by that service's own privacy settings. The LifterLMS protected media documentation makes the same point.
Some files are protected automatically. Files students upload as assignment submissions, with the Assignments add-on, and as answers to upload questions, a question type from the Advanced Quizzes add-on, are stored as protected files, so other students cannot open each other's work.
When you protect a file, three things happen:
wp-content/uploads/lifterlms/, together with its resized image versions. LifterLMS writes an .htaccess file there that denies direct access on Apache, plus blank index files to stop folder listings.https://example.com/?llms_media_id=123, instead of the file path.By default the file is served to:
Everyone else gets a "File not found" response with a 404 status. Add-ons that protect their own files can add their own rules on top.
The block's URL is updated to the protected address automatically. The dialog also shows which course or membership currently protects the file.
Read the warning that appears: existing links to the file stop working once it moves. If you already inserted the file into lessons as a plain link, re-insert it afterwards so the content points to the protected URL. The cleanest workflow is to protect a file first and then use it in your lessons.
There is no button to unprotect a file. You can change which course or membership protects it, but moving it back to a public location means re-uploading it as a new file. Decide what should be public, such as a free lead magnet, before you protect anything.
This is where most protection quietly fails. The deny rule LifterLMS writes is an .htaccess file, which only Apache and compatible servers read.
.htaccess rule blocks direct access automatically..htaccess files are ignored. Without a server rule that blocks /wp-content/uploads/lifterlms/, the original file path may still be reachable by anyone who knows it. Ask your host or developer to add a deny rule for that folder, and an internal location if you use X-Accel-Redirect.Test it. Find the real path of a protected file (it is under wp-content/uploads/lifterlms/ plus the year and month folders), open it in a private browser window while logged out, and confirm you get a 403 or 404. Then open the protected URL as an enrolled test student and as a non-enrolled one. Do this after every server move.
Where the server supports it, LifterLMS hands delivery back to the web server with an X-Sendfile header (Apache with mod_xsendfile, lighttpd, Cherokee) or X-Accel-Redirect (Nginx), which is fast. Otherwise PHP reads the file and streams it, which ties up a PHP worker for every download. Developers can change the method with the llms_media_serve_method filter.
Two practical consequences for video: protected files are served without HTTP range request support, so seeking in a large video can be poor, and streaming long videos through PHP is heavy on the server. For video lessons, a proper video host with domain restrictions is usually the better choice. See the best video hosting for LifterLMS for the options.
A protected URL works only for a logged-in user with access. That is a problem when the request comes from somewhere without a WordPress login, such as a grading tool, a mobile app or a reporting system that downloads assignment files.
LifterLMS 10.2 added time-limited signed URLs for exactly this. A signed URL carries an expiry time and a token generated from your site's secret keys. Anyone holding it can download that one file until it expires, after which it stops working. The REST API now includes a download_url field with a signed link for files in assignment submissions and quiz attempts, so integrations can fetch them; see our introduction to the LifterLMS REST API and webhooks.
Links last one hour by default. The llms_media_signed_url_ttl filter changes that. Developers can also create signed links themselves, after doing their own permission check:
<?php
/**
* Return a 15-minute download link for a protected file, or an empty string.
* Only call this after you have confirmed the requester may have the file.
*/
function llmsx_temporary_file_link( $media_id ) {
$protector = new LLMS_Media_Protector();
if ( ! $protector->is_media_protected( $media_id ) ) {
return '';
}
return $protector->get_signed_url( $media_id, 15 * MINUTE_IN_SECONDS );
}
Treat signed URLs like passwords with an expiry date. Do not put them in public pages or long-lived emails, and keep the lifetime as short as the use case allows.
Under LifterLMS > Settings > General there is a Content Protection checkbox described as preventing users from copying website content and downloading images. It adds browser-side copy and right-click blocking for users without Unrestricted Preview Access.
It is a useful deterrent against casual copying, but it is not file protection. Anyone determined can read a page's source or use developer tools. Use it alongside media protection, not instead of it. For other anti-sharing measures, see how to stop account sharing in LifterLMS.
wp-content/uploads..htaccess. It does not. Test the direct path.?llms_media_id= requests from page caching and CDN caching rules so one student's access is not cached for everyone.No. Media protection applies to files in your own media library. Use the video host's privacy and domain-restriction settings for hosted videos.
The core setting links a file to one course or membership. If several courses need the same file, protect it for a membership that includes them, or ask a developer to add an authorization rule.
The file is protected for a different course or membership than the one they are enrolled in, they are logged out, or a cache served a response meant for someone else. Check the protection in the Media Library first.
Yes. Files submitted through the Assignments add-on and through Advanced Quizzes upload questions are stored as protected files.
List the files that are worth protecting, usually workbooks, templates and downloadable resources rather than every image, then protect them for the right course or membership and run the direct-path test from a private window. If you are on Nginx, get the server rule added before you rely on any of it.
If you need protection for files in S3, rules across several products, or watermarked downloads, our LifterLMS customization team can build it. For a full review of how exposed your course content is, our LifterLMS support plans include security checks. Get in touch and tell us what you need to keep private.
How LifterLMS course tracks turn separate courses into a learning path: create a track, require it before an advanced course, award a certificate…
Read article
How to switch on LifterLMS focus mode for the whole site or one course, exactly what it changes on lesson and quiz pages, how it behaves with your…
Read article
LifterLMS 10.3 added a Customers screen under Orders. Here is what each number means, how the five segments are calculated, and practical ways to use…
Read articleSkip the trial and error. Get specialist LifterLMS help and ship faster.