By default, WordPress doesn’t offer a way to protect WordPress media files. Every photo, PDF and ZIP you upload gets a public address, and anyone with that address can open it.
“Protect” can mean sharing files with only certain people, keeping them out of Google, or keeping your name on a copied photo. Most tools do just one: a gallery password hides the gallery, but the photo files still open.
So for every tool below, we answer one question: does the file URL still open?
In short
- Paste a file’s URL into a private window. If it loads, it’s public.
- A plugin, a server rule or a download manager locks the file itself.
- Gallery passwords protect the page. A watermark changes the file.
What WordPress leaves public
WordPress leaves four things open to logged-out visitors:
- Every file in uploads. A private or password-protected post hides the post, not the PDFs and photos you uploaded to it.
- Your full-size originals. Since WordPress 5.3, images over 2,560 px get a “-scaled” copy for your pages. The original stays next to it.
- A list of your Media Library.
/wp-json/wp/v2/medialists file URLs to anyone. Files attached to private or draft posts are left off, but their URLs still work. - Attachment pages, on older sites. They’re off for new installs since WordPress 6.4, but upgraded sites keep them.
Tip
Test your own site in two minutes. In a private window:
1. Paste the URL of an image or PDF you think is private. 2. Visit yoursite.com/wp-json/wp/v2/media. 3. Delete “-scaled” from an image URL that has it.
On our WordPress 7.1.3 test site (October 2026), all three gave files away. One edit turned a 2,560 px photo into its 3,709 px original.

Protect WordPress media files in the uploads folder
Three things can stop a WordPress file from opening by its URL: a plugin, a server rule or a download manager.
With a plugin
Prevent Direct Access is the easiest. Its free version has 10,000+ active installs and a 4.6/5 rating (checked October 2026).
Mark a Media Library file as protected, and only admins and the file’s author can open it. Everyone else gets your 404 page.
The catches: NGINX and IIS need a config change, and logged-in or role access needs the paid Gold version.
With a server rule
A referrer rule answers 403 when a file request doesn’t come from your own pages. On Apache, Perishable Press has a short .htaccess rule.
NGINX ignores .htaccess, so the rule goes in the server config. This one follows the NGINX docs; we tested it on NGINX 1.26.1 (October 2026):
location ^~ /wp-content/uploads/private/ {
valid_referers blocked server_names;
if ($invalid_referer) { return 403; }
}
- Keep the
^~. Without it, a typical image caching rule takes priority, and the file opens anyway. - Add
noneto allow pasted links. Without it, a pasted or bookmarked link gets a 403 too.
The NGINX docs warn that faking a referrer is “quite easy”, so this stops casual sharing, not a determined person.
Good to know
Back up first, then test. One typo can take a site down, so copy your config or ask your host. On NGINX, run nginx -t before reloading. Then open the file on your page and in a private window.
By moving files somewhere private
For documents, a download manager is simpler: people get a link, never the file’s address. Big sites sometimes use a private cloud bucket with short-lived signed URLs, as Delicious Brains explains.
Protect gallery photos with Modula
Of Modula’s four Protect switches, only Watermark changes the file. The other three work on your page. We make Modula (160,000+ active installs).

Put a gallery behind a password or an invite
Say you’re a wedding photographer sharing 300 proofs with one couple. Under Protect, turn on Password protect (Trio and up), then fill in Set password and Protect text. Visitors see a password form instead of the photos.
Image Proofing (Business and up) shows the gallery only to people you invite. Its invite links need Galleries get their own page (Modula → Settings → Galleries), which gives every gallery a public page.
Does the file still open? Yes. Both hide the gallery, not the files: if the couple texts a photo’s address to a cousin, it opens. Our password-protected gallery guide has the full setup.
Hide the real file address
Hide the real file address (Image Guardian, Trio and up) swaps the gallery’s main image and lightbox links for signed /modula-image/ addresses that expire after a week.
In our October 2026 test, signed links loaded on the page but returned 403 in a new tab, with no referrer or from another site.


Does the file still open? Yes. On a 3.0 gallery, the responsive image list (srcset) keeps the normal uploads URLs, which browsers load and the page source shows. Signed images also skip your CDN, and Modula’s download button still hands out the real file.
Watermark the files themselves
Watermark (Business and up) writes your mark into the Media Library image and regenerates its sizes, so your galleries show the marked photo. Photos already placed in posts keep their old addresses, which can break or show the clean copy, so re-insert them.

Does the file still open? Yes, with your mark on it, but on photos over 2,560 px the clean “-scaled” copy can stay in uploads.
Delete “_w” from a watermarked photo’s URL to find it, and remove it in your host’s file manager. Then Watermark is the strongest of the four.
Good to know
Turn on backups before you click Watermark images. The gallery’s Keep originals without watermark only counts when Override global watermark is on.
Otherwise the site-wide Keep the original images (Modula → Settings → Protection) applies, and it’s off by default, so the clean original is gone for good. Backups land in /wp-content/uploads/modula/gallery-<ID>/, a public folder with no protection of its own.
Right-click blocking (Modula’s, or a plugin like WP Content Copy Protection & No Right Click) and image licenses don’t touch the file. See our guides to disabling right-click and stopping image theft.
Protect documents and downloads with Download Monitor
Download Monitor hands out PDFs, ZIPs, audio and video through download links instead of the file’s address. We make it too. It’s free, with 80,000+ active installs (checked October 2026).
Say a course creator’s PDF workbook should reach students only. Under Downloads → Add New, use Upload file instead of the Media Library, so it lands in Download Monitor’s dlm_uploads folder. Then lock it:
- Members only: logged-in users only.
- Password: set the download’s Visibility to Password protected.
- Rules: Advanced Access Manager limits who downloads, and how often, by role, user or IP (Complete plan).

Does the file still open? Not on Apache, where an .htaccess file locks dlm_uploads. NGINX ignores it, so add the rule from the plugin’s settings:
location ^~ /wp-content/uploads/dlm_uploads { internal; }
Keep Redirect to file off: it reveals the real address. Downloads also send X-Robots-Tag: noindex, nofollow, which keeps them out of search results.
Keep private files out of Google
An X-Robots-Tag: noindex header keeps a file out of search results. Google’s example (checked October 2026) sets it for every PDF on an Apache site:
<Files ~ "\.pdf$">
Header set X-Robots-Tag "noindex, nofollow"
</Files>
On NGINX, add the same header in a location ~* \.pdf$ block. Don’t also block those files in robots.txt, or Google never sees the noindex.
Stop other sites hotlinking your images
Hotlinking is another site showing your images straight from your server. Modula has no protection for it.
Cloudflare’s Hotlink Protection helps, but only for JPG, PNG, GIF and ICO files, and it lets blank referrers through (checked October 2026). It also keeps your images off Google Images, Pinterest and Facebook.
Which tool for which file?
Only a plugin, a server rule or a download manager stops the file URL from opening (checked October 2026).
| You want to protect | Use | Does the file URL still open? |
|---|---|---|
| Any Media Library file | Prevent Direct Access | Only for admins and the author |
| A private folder | A server referrer rule | No, unless the referrer is faked |
| Member PDFs and ZIPs | Download Monitor | No (on NGINX, after the rule) |
| A client gallery | Modula Password protect or Proofing | Yes |
| Lightbox links | Modula Hide the real file address | Signed link: no. Real file: yes |
| Your credit on copies | Modula Watermark | Yes, watermarked (delete the old -scaled copy) |
| Files in Google | X-Robots-Tag: noindex | Yes, but not indexed |
Frequently asked questions
Yes. Download Monitor is free, Prevent Direct Access has a free version, and a server rule costs nothing. Modula’s protection tools need a paid plan.
Upload it with Download Monitor’s Upload file, not the Media Library, and set Visibility to Password protected. On NGINX, add the plugin’s dlm_uploads rule too. A password on the page linking to it isn’t enough: the file’s URL still works.
On the page, yes. At their file addresses, no: anyone with the direct link can still open them.
Use Download Monitor’s Members only for downloads, or Prevent Direct Access’s paid Gold version for any Media Library file.
It can. Perishable Press’s rule covers all of uploads and lists missing image search results first among its cons. Protect only your private folder, not your public photos.



