Tutorials

Anyone With the Link Can Open Your Form Uploads. The Fix

A form upload link opening a private CV in a logged-out browser window

Someone sends you their CV through your contact form. Or a passport scan, a doctor’s letter, a voice recording. It lands in WordPress, and on a lot of sites it sits at a plain web address that anyone can open. No login, no password. Just the link.

Last updated 18 November 2026. We tested on a local WordPress 7.0.2 site (PHP 8.4) with Contact Form 7 6.1.7 + Flamingo 2.6.4 and Trinity Forms 2.28.0, and read the code of Forminator 1.58.6.

This isn’t a made-up worry. In late October a Forminator user wrote on the support forum that “uploaded recordings can be accessed through their direct file URLs without WordPress authentication.” The reply from support: Forminator “doesn’t support configuring the uploads folder outside the uploads directory out of the box,” and “you’ll need to hire a developer.” Around the same time a CFDB7 user pointed out that the file links shown in the admin and in CSV exports, “once known they grant unauthenticated, non-revocable access.”

So let’s work out whether your uploads are exposed, and what you can actually do about it without hiring anyone.

Why form uploads end up public

WordPress keeps media in wp-content/uploads/. That folder is inside the web root, the part of your server that’s handed out to anyone who asks for a URL. That’s exactly what you want for blog images. It’s exactly what you don’t want for a stranger’s ID card.

Many form plugins drop uploads into a sub-folder of it, like uploads/forminator/ or uploads/cfdb7_uploads/. Some add a random folder name, which makes the URL hard to guess. Hard to guess isn’t private, though. The link travels in notification emails, CSV exports, browser history and forwarded messages, and whoever ends up holding it can open the file.

What we found when we tested

We submitted a tiny test PDF to each form while logged out, then looked at where it landed on disk and tried to fetch it.

Plugin Where the file went Fetched logged out?
Contact Form 7 6.1.7 + Flamingo 2.6.4 uploads/wpcf7_uploads/2528252245/p1-cv-test.pdf, deleted the same second once the email was sent Nothing left on the server to fetch
Trinity Forms 2.28.0 (ours) /home/<user>/trinity-forms-private-<12 characters>/2026/11/<random>/p1-cv-test.pdf, beside the WordPress folder, not inside it No. The download link returned a 302 redirect to the login page
Forminator 1.58.6 (code read, not tested) uploads/forminator/<form id>_<hash>/... Not tested by us

A few things worth knowing from that:

  • Contact Form 7 doesn’t keep the file. We watched the folder while submitting. CF7 created a random folder, saved the PDF, attached it to the email and deleted both, all within the same second. Flamingo, CF7’s storage add-on, kept only a SHA-256 fingerprint of the file (a 64-character code), not the file itself. So with plain CF7 the copy lives in your mailbox. That’s a different risk (mailboxes get forwarded and hacked), but there’s no public URL. The public-URL problem starts when you add a plugin that saves CF7 uploads to disk, like CFDB7.
  • Forminator’s main upload folder isn’t locked. In the 1.58.6 code, the .htaccess it writes into uploads/forminator/ switches off script running and asks search engines not to index files. It doesn’t deny downloads. Only the temp sub-folder (files waiting for the form to be sent) gets a deny rule. That matches what the forum user saw.
  • Several free plugins don’t take files at all. In the versions on our test site, File Upload is a paid field in Fluent Forms (free 6.2.14) and WPForms Lite (2.0.1.1), and Formidable’s free plugin has no file field. If you’re on those, the question is for whoever runs the paid version.

Check your own site in two minutes

  1. Open a form entry that has a file, in your WordPress admin.
  2. Right-click the file link and copy it. If it starts with /wp-content/uploads/, it’s a direct file link.
  3. Paste it into a private (incognito) browser window, where you’re not logged in.
  4. If the file opens, so can anyone else’s copy of that link.

If you like the terminal, curl -I followed by the URL does the same job. A 200 means it’s served; 403 means it’s blocked.

Fix 1: block the folder at the web server

This is the quickest fix, and the one most people reach for first. Which snippet you need depends on your web server, and that matters more than people expect.

Apache: a .htaccess file

Put a file called .htaccess inside the upload folder (for example wp-content/uploads/forminator/) with this in it:

# Apache 2.4+
<IfModule mod_authz_core.c>
    Require all denied
</IfModule>
# Apache 2.2
<IfModule !mod_authz_core.c>
    Order deny,allow
    Deny from all
</IfModule>

This only works if your host lets .htaccess files override settings (the AllowOverride setting). Most shared hosts do. Test with the incognito check above afterwards; a 403 means it worked.

nginx: a location block

Here’s the catch. nginx never reads .htaccess files. They just sit there doing nothing. If your host runs nginx (a lot of managed WordPress hosts do), the deny rules a plugin writes for you are decoration.

We saw the same thing on our test site, which runs on PHP’s built-in server: we put a deny .htaccess into a test folder in uploads, dropped a PDF next to it, and fetched it logged out. 200, PDF delivered. The rule was ignored.

On nginx you, or your host, add a block to the site’s server config:

location ^~ /wp-content/uploads/forminator/ {
    deny all;
}

The ^~ matters. It tells nginx to stop looking once this prefix matches, so a later rule for images or PDFs (common in caching setups) can’t serve the file anyway. Swap the path for your plugin’s folder, reload nginx, then run the incognito check again. On managed hosting you usually can’t edit this yourself, so send the snippet to support.

The catch with both

Blocking the folder blocks everyone, you included. If your plugin’s admin screen or notification email links straight to /wp-content/uploads/..., those links break too. You’d need the plugin to hand out files through a logged-in download handler (a WordPress URL that checks who you are, then streams the file). If it doesn’t have one, you’ll be grabbing files over FTP. Annoying, but at least it’s only annoying for you.

Fix 2: store the files outside the web root

The proper fix. If the file lives in a folder the web server doesn’t map to any URL, there’s no link to leak. Your server config stops mattering at all.

Honestly, though, this needs code. Roughly: hook WordPress’s upload_dir filter so the form’s uploads go to a folder above public_html, then write a download handler that checks current_user_can() before reading the file out. That’s what the Forminator user was told to hire a developer for, and it’s a reasonable job for one. Don’t attempt it with a snippet you found in a comment; a sloppy download handler can let people read any file on the server, including wp-config.php.

Fix 3: don’t collect the file at all

The safest upload is the one you never receive. Ask yourself whether you really need the file on your website.

  • For CVs, a field asking for a LinkedIn or portfolio URL often does the job.
  • For big or sensitive documents, ask people to share a link from their own cloud storage, restricted to your email address. They keep control, and they can revoke it.
  • For ID checks, use a service built for that rather than a contact form.

Our guide to GDPR and WordPress forms covers this “data minimisation” idea in more depth, and why it counts legally, not just as good manners.

Fix 4: delete old files

Whatever you do above, a file from 2021 that nobody needs is pure risk. Pick a retention period (90 days for job applications, say), and actually clear old entries and their files. Check that your plugin deletes the file from disk when you delete the entry, not just the database row. Some don’t. We wrote up how to auto-delete old form entries, including a WP-Cron snippet.

And don’t forget your mailbox. If files arrive as email attachments, that’s where they pile up.

How Trinity Forms handles uploads

Full disclosure: Trinity Forms is ours. We built its upload storage around exactly this problem, so here’s what it does, and what we saw on the test site.

  • The File upload field is in the free version (since 2.9.0). You choose the allowed file types, a size limit, and whether more than one file is allowed.
  • Uploads go into a folder outside the web root, beside the WordPress folder, one per site, when the host allows writing there. On our test site that was /home/<user>/trinity-forms-private-<12 characters>/, while WordPress itself lives in /home/<user>/<site>/.
  • If nothing outside is writable, it falls back to uploads/trinity-forms/ with a random sub-folder plus deny rules. That fallback carries the same nginx caveat as Fix 1, so it’s worth checking which one you got.
  • Every download link the plugin prints is a signed link that streams the file only to someone allowed to manage entries. Logged out, our test link got a 302 to the login page; logged in as admin, it returned the same PDF byte for byte. With one character of the signature changed, it returned a 404.
  • A logged-out click, say from the notification email, goes to the login page and then back to the file. So the email links keep working for you.
  • You can move the folder with the TRINITY_FORMS_PRIVATE_DIR constant or the trinity_forms_private_upload_root filter.
  • If you delete the plugin, uploaded files stay in their private folder. They don’t get spilled into the public uploads folder.

It needs PHP 8.2 or newer. It’s a free download from our site.

For the wider picture, like which file types to allow, size limits and why big attachments break notification emails, see our guide to file uploads in WordPress forms.

Frequently asked questions

Does a random folder name make my form uploads private?

No. It makes the URL hard to guess, but anyone who gets the link from an email, an export or a forwarded message can still open the file. Only a server block or storage outside the web root actually stops them.

Why doesn’t my .htaccess rule block the files?

Most likely your site runs on nginx, which ignores .htaccess files completely. You need a location block with deny all in the nginx config instead. On Apache, check that your host allows .htaccess overrides.

Does Contact Form 7 store uploaded files on my server?

Not for long. In our test with Contact Form 7 6.1.7, the file was saved to a temporary folder, attached to the email and deleted in the same second. Flamingo kept only a fingerprint of the file. Add-ons that save CF7 uploads to disk are a different story.