How to Restrict User Access to Downloadable Files in WordPress
As an online business owner, there are tons of scenarios where you might need to restrict user access to downloadable files. This ensures that only authorized users can access the files.
In this article, we’ll take a look at some examples of websites that might need to provide users access to downloadable files. We’ll also explain how you can restrict user access to downloadable files in WordPress.
When you might need to restrict access to downloadable files in WordPress
Whether you’re looking for a secure way to share files and documents with employees or grant paying members access to certain resources, you need a simple way to restrict access to downloadable files.
Here are some common use case scenarios of websites that grant specific types of users access to files:
In its simplest form, a membership site is a gated or protected part of your business website that only paying members have access to. Only members can view the content you add to your membership site. This is great for anyone looking for a way to sell training programs or online courses.
As a membership site owner, you need a way to restrict user access to downloadable files and resources. This way, you can rest assured that only paying members have access to the correct downloadable resources, e-books, and worksheets. Or, if you share video lectures or training sessions, you might want to give members the option to download them to their device to view on-demand.
For more information, be sure to check out our tutorial on How to Create Member’s Only Content in WordPress (Without a Membership Plugin).
An agency provides some sort of digital services to clients and typically have a client portal that allows the agency’s clients to access files, documents, and forms.
For example, if you’re running a photography agency, you might need to grant your clients access to their photo albums so they can pick and choose the ones they’d like to pay for. Agency sites with client portals also make it easy for businesses to provide downloadable links to templates and forms that clients can access directly instead of placing a request via email.
Intranet sites are used by companies to facilitate internal communication and collaboration in a secure and efficient way. This includes having the ability to share downloadable files, forms, and marketing collateral with employees.
Restricting user access to downloadable files in your intranet means that employees with the correct user roles will have access to the files that are relevant to them. For example, you might want to provide your sales department access to sales battle cards and other marketing materials and your accounting department access to balance sheet templates.
Check out our tutorial on How to Set Up a WordPress Intranet Site for Your Organization for step-by-step instructions.
How to restrict user access to downloadable files in WordPress
The easiest way to restrict user access to downloadable files in WordPress is by using plugins. Here, we’ll walk you through a step-by-step process to help you restrict user access to downloadable files for specific users and user groups.
For this tutorial, you’ll need the Filr plugin and Passster plugin installed on your WordPress website. We’ll use the Filr plugin to manage downloads and the Passster plugin to restrict access by user role. You’ll also need some downloadable files that you’d like to restrict user access to.
Step #1: Create a new list for downloadable files using Filr
To get started, create a list for the files you’d like to grant users access to. The key benefit of organizing files into lists is that it helps you keep the back-end clutter-free and makes it easy to manage files in the long run.
Navigate to Files > Lists from the WordPress admin panel and enter a name and description for your list. Click the Add New List button to continue.
The list will appear in the right-hand side of the screen along with an automatically generated shortcode.
For now, copy the shortcode to your clipboard.
Step #2: Upload files and downloadables to WordPress
Now that we’ve created a list to organize the files into, the next step is to upload the downloadable files to WordPress.
One of the key benefits of using Filr is that it doesn’t upload files to your WordPress Media Library. Instead, the plugin stores the files in a secure folder on your website so unauthorized users can’t access them.
To upload files, go to Files > Add New from the WordPress admin panel and enter a title for the files. Once that’s done, use the File Upload meta box to upload the files and resources to your website. Finally, select the list you created in Step #1 from the Lists meta box in the right-hand sidebar.
Note: You can upload multiple files to each new file you create in WordPress. This way, users can download multiple files to their device in a file archive. If you’d like to display individual files per row in your front-end files library, create multiple files and sort them under the same list.
In addition to this, you can also expire documents either by date or by the number of downloads. Filr also gives you the option to enable file name encryption to further secure them from being accessed directly.
Once you’ve uploaded all of the files you’d like to make available to users, click the Publish button.
Step #3: Add downloadable files library to a page
Now that we’ve uploaded the files to WordPress and organized them under the correct list, it’s time to display the downloadable files library on the front-end.
For this, you’ll need to create a new page by going to Pages > Add New. Enter a title for the files library page and paste the shortcode you copied to your clipboard in Step #1 to a new shortcode block. Click the Publish… button to continue.
A downloadable files library will be rendered on your site’s front-end:
Pro tip: Head over to Files > Settings > Shortcode to customize the look and feel of the front-end file library.
Step #4: Grant users access to the downloadable files
By now, we’ve created a front-end downloadable file library that users can access to download files to their device. Now we open the file and limiting the access to specific users (by e-mail) or user roles:
Take a closer at “User Options” here you can find two options: restrict by e-mail or user role. You can also use both together to further customize the restriction:
One last tip: Administrators have always access to all files without any restrictions, so make sure you test the restriction accordingly with a new user account.
By restricting user access to downloadable files in WordPress, you can rest assured that only authorized users are able to access the files and resources you upload to your website.
The Filr plugin makes it incredibly easy to create a downloadable files library in a secure and organized way.