How to restrict file downloads by user role or membership in WordPress Pro
WordPress files are public by URL. To restrict downloads by role or membership, check permission on each download and keep the file out of public uploads.
Updated September 26, 2026
To restrict downloads by role or membership in WordPress, you need two things: a permission check that runs on each download request, and a file that is not sitting at a public URL. Hiding the link or the page is not enough, because WordPress serves uploaded files directly to anyone who has the address.
What does WordPress do on its own?
WordPress has users and roles — Administrator, Editor, Author, Contributor and Subscriber by default. Roles decide what someone can do in the dashboard. They do not decide who can open a file.
When you upload a PDF, WordPress saves it under wp-content/uploads/ at a predictable year-and-month address. The web server hands that file to whoever requests it, without loading WordPress, so no login check takes place.
The built-in visibility settings for pages do not change that:
- Private pages are visible only to users who can read private content — by default, Administrators and Editors. That rules them out for a Subscriber-level member area, and files linked from a private page stay public.
- Password protected pages hide the page content behind one shared password. The file URL underneath still works without it.
Membership plugins add paid levels and restrict pages and posts. Whether a particular plugin also protects the uploaded file itself varies, so check before you rely on it.
What are the ways to restrict downloads?
| Approach | Stops a copied file URL? | Control by role or plan? | Main drawback |
|---|---|---|---|
| Private or password-protected page | No | No | Hides the link, not the file |
| Server rules that block the uploads folder | Yes, for all visitors | No, on its own | Also blocks the people who should have access; .htaccess rules are ignored on nginx |
| Server rules plus your own script that checks the login first | Yes | Yes, if you build it | Custom code to maintain through server moves and updates |
| A download manager or document library plugin with access control | Yes, when it moves protected files out of public uploads | Yes | One more plugin to run — check how it treats the file itself |
The last two rows do the same job: they put a permission check between the visitor and the file. The difference is whether you write and maintain that code yourself.
What should a good setup do?
Whichever tool you choose, check it against this list:
- It checks permission before handing out a working download link, not only when it draws the list.
- It moves restricted files somewhere the web server will not serve directly.
- It lets you decide what refused visitors see — a locked entry, no entry, or a sign-in prompt.
- It follows the membership. When a role or plan is removed, access ends without anyone editing documents.
- You can test it as a real member. Administrators usually pass every rule, so testing as one proves little.
How to restrict downloads by role with FileDeck
FileDeck’s free version publishes a searchable document library in which documents are public. Access control — role restrictions, logged-in-only documents, membership-plan gating and file protection — is part of FileDeck Pro.
FileDeck Pro — the restriction and file-protection steps below are included in all Pro plans. See pricing
- Build the library.
Free — install FileDeck from wordpress.org, add your documents, and publish them with the Document Library block or the
[filedeck]shortcode. See the quick start. - Group restricted documents into categories such as Members or Staff. A category’s restriction also covers its sub-categories, so set it at the highest level that should be protected.
- Restrict each category by role.
Pro — go to Documents → Document Categories, edit the category, and tick the allowed roles under Restrict to roles (FileDeck). The list shows the roles registered on your site, so a role added by another plugin appears alongside the five standard ones. Leave all boxes unchecked to keep a category public. See restrict documents by role.
- Or gate a category by membership plan.
Pro — if you run MemberPress, Paid Memberships Pro, WooCommerce Memberships, Restrict Content Pro or s2Member, tick plans under Client area — membership plans (FileDeck) on the category. The plan is checked when the page is drawn, so access ends when a membership lapses and returns on renewal. Plan-gated documents are hidden from non-members rather than shown locked. See membership plans.
- Restrict single documents.
Pro — in a document’s Document File box, Visibility offers Public, Logged-in users only, Author only and Specific people only. To change many at once, tick them in the Documents list and choose the bulk action Access: logged-in users only.
- Choose what refused visitors see.
Pro — by default a restricted document appears as a padlocked row. Tick Hide restricted documents entirely under Documents → Settings → Features to remove it from listings, or send refused visitors to a page of your own under Documents → Settings → Downloads → When access is refused. See custom access-denied page. The free
[filedeck_login]shortcode adds a sign-in prompt to any page. - Let file protection do its part.
Pro — as soon as a document is restricted, FileDeck moves its file into a protected folder and serves downloads through signed links that expire after 15 minutes. Apache needs no setup; nginx needs one config snippet — see protect files on nginx servers.
- Test as a member, not as an administrator. In a private browser window, restricted documents should show a padlock (or not appear) and downloads should be refused. Sign in with a test account on an allowed role, then with one on a role you did not allow. Finally, paste a restricted file’s old uploads URL — it should no longer return the file.
For finer control, Pro also offers download quotas (daily limits per role, including logged-out visitors) and groups for named sets of people rather than whole roles.
Role, plan, password or named people?
| You want | Use |
|---|---|
| A section for one or more roles, such as Staff | Role restriction on the category |
| Access that follows a paid membership | Membership-plan gating |
| Anyone who is signed in | Visibility → Logged-in users only |
| Visitors without accounts, sharing one secret | Category password |
| A private space per client or customer | Client areas — see how to create a client document portal |
If you are unsure, prefer accounts over passwords. A password can be forwarded; an account can be removed.
FAQ
Can I restrict downloads to logged-in users without a membership plugin?
Yes. WordPress user accounts are enough. With FileDeck Pro, set a document’s Visibility to Logged-in users only, or tick each role your site assigns under Restrict to roles (FileDeck) on a category.
What happens when a member’s subscription ends?
If your membership plugin removes the member’s role, role restrictions stop admitting them. With membership-plan gating, FileDeck asks the membership plugin whether the plan is active, so access goes when the plan lapses and comes back on renewal, without re-ticking anything.
Can a member share the download link with someone else?
Download links for restricted documents are signed and expire 15 minutes after the page was loaded. Until then anyone holding the link can use it; after that it stops working, and getting a fresh one means passing the permission check again. So a forwarded link does not give lasting access. To hand one file to one person who has no account, use a single-use download link.
Is access control included in the free version?
No. In the free version, documents are public. If a Pro licence lapses, the plugin falls back to the free version and restrictions you have already set stay enforced, so restricted documents do not become public.
Do administrators see restricted documents?
Yes. Site administrators pass all FileDeck restrictions by design, which is why you should test with a real member-level account.
Next steps
See a working library on the live demo, and read how signed download links work and the access control overview. If your documents belong to a paid member area, the members document library page covers that set-up, and the WordPress document library plugin roundup compares the options.
Still stuck? Email support@getfiledeck.com.