Looking for the best way to protect WordPress media files? We’ll show you how to protect media files with WordPress features & plugins!

Approximate read-time: 5 minutes
Looking for ways to protect WordPress media files? We’ll show you how to protect media files with WordPress features & plugins!
File sharing is one of the best ways to grow a business or expand an online audience. But sometimes you don’t want to share all your files with everyone. This is where you need to use WordPress to protect media files from being shared in ways you don’t want.
Maybe you have gated content that is for paid users or members? Maybe you want to use WordPress to password protect media files on your site? Well, today we are going to show you 4 ways to protect file access on your WordPress site.
The good news? You’ll just need one plugin to do it all: a WordPress form builder called Formidable Forms. Using these methods, you can use WordPress to protect PDF files & more. Actually, you can protect uploaded PDF documents, audio files, images - anything in your media library!
You can even convert these to a PDF if you want another record of your files using our PDF add-on!
How does Formidable Forms protect your files?

Before we show you a few ways to protect your files using WordPress, we want to tell you a bit about how file protection works in Formidable Forms. Although we’ve always been big on file protection, our September 2020 update has taken things to the next level!
Prior to this update, Formidable had an option to protect your files already, but it only worked for users running WordPress on an Apache server. That would cover most WordPress websites, but left out those sites using NGINX servers, which includes WPEngine sites for example.
Besides adding NGINX support, this update enhances file protection by locking direct file access to everyone (by creating URLs that aren’t guessable). It also adds an option to add role restrictions so a file can only be downloaded by specific user roles.
Formidable Forms also prevents files from being indexed by Google (and other search engines). This means your files will never appear in any web search.
Now that we’ve got that out of the way, we’re going to show you four different ways to use WordPress & Formidable to protect your media files.
1. Use WordPress to password protect files
Did you know you can password protect media files in WordPress without any extra plugins? This method is really simple, but it won’t prevent anyone from simply sharing the URL of the file you want to share.

Still, this is a very quick way to restrict access to a post or page contains a link to the files you want to protect. Here’s how it works:
- Create a new WordPress post or page
- Copy and paste a link from your media uploads directory
- Edit the page or post Visibility to Password protected
- Choose a password and update
That’s it! Now users can simply enter the password to access the page & files.
Since this will just be a direct link to your wp-content/uploads directory, it won’t be very secure. If somebody can guess the password to the page, or if somebody shares the link, your files could be at risk.
2. Use WordPress to protect files based on user roles
Another way to use WordPress to restrict access to media files? Only allow certain user roles to access them. This can be useful in a variety of ways:
For example, you could only allow administrator roles to view all uploaded media files. You could also prevent users from viewing/editing their own file uploads. The most simple option would be to prevent direct access to everyone except logged in users.

By default, WordPress has the following user roles: Administrator, Editor, Author, Contributor, and Subscriber. Of course, restricting file access based on user roles is kind of tricky unless you have a plugin like Formidable Forms to help!
Not only can you choose which users can access which files, but Formidable also includes an advanced user registration add-on to make the WordPress user system much more dynamic.
3. Restrict content for members only
Of course, you can take the previous concept to the next level by using a WordPress membership plugin (like MemberPress for example). If you’re not sure about using one of those, check out our article on the topic: How to Know When You Need a Membership Plugin.

A membership plugin will allow you to protect pages, posts, individual files, and more, based on a user’s membership level. The only downside is that membership plugins are often expensive. Usually, you’d only use one if you are running a dedicated membership website.
4. Create a form to protect WordPress files
With Formidable, you can create a form to and upload your files with our file upload field. Then you can use WordPress to prevent direct access to uploads with the “protect all files” feature in Formidable.
Simply put, every file you upload with this form will be virtually invisible to all users, members of search engines (unless you choose otherwise).
And if you want to provide the most secure access to these protected files, a download button won’t cut it. But the guide to require email to download protected files will help. It shows how to check if a user has access to the files.

Why use a dedicated file protection plugins for WordPress when you could use Formidable Forms?
Finally, you can protect content by requiring a form submission before viewing. We call this the show page content feature. You can mark the page as Private, making it inaccessible to users, but the content from that page can still be used in the success message. So you would just need to put your files there for another layer of protection!

Wrapping up
If you want to use WordPress for private media file management, we hope this article has left you inspired! For more tips on file uploads & WordPress, stay tuned to the Formidable blog. Until next time, have a great day!
Read more of our file upload posts
If you haven’t tried Formidable Forms, our users love it for its range of features. It’s much more than just a drag and drop form builder. See for yourself - try one of our premium plans risk-free for 14 days with our 100% money-back guarantee!
Thanks for sharing the benefits of Formidable form.
Yes, it would be much helpful to get all this functionality instead of using extra plugins on a website. Nice & attractive feature. Much beneficial. +1
This is available in PRO version only or available in the FREE version too?
File upload fields are available in all premium versions of the plugin, Basic through Elite.
is it possible to protect the media files but not require an email, but just have a download button instead?
pretty much to use the plugin to protect the direct access to the file, but not require any forms filled out to access it?
Hi Horo,
Thanks for your question. I'm not sure I understand you 100%, but this sounds like something Formidable Forms could handle. If you would like to create a new support ticket with more information so our support team can confirm, that would be great!
Hi Wells fam,
I just discovered that Google indexed all of my clients' PDFs, "Indexed, not submitted in sitemap". While that's not an issue right now, I could see that being an issue.
Your article stated "Formidable Forms also prevents files from being indexed by Google". How does it do this? I assume it's only if a file is uploaded to the site through a Formidable form?
I thought there would be an option in Yoast, but apparently if there was an option for Media Library files it was removed in an update.
Hi Abby,
Please take a look at the file protection section here: https://formidableforms.com/knowledgebase/file-upload/#kb-file-protection
If you have additional questions, please create a ticket for our support team so we can help you with this.