Linux 软件免费装
Banner图

Birim Private Files – Protect Uploads & Private Pages

开发者 birimone
更新时间 2026年11月18日 17:23
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

members only restrict content protect uploads private files protect media

下载

1.0.0

详情介绍:

Protect media files, PDFs and uploads in WordPress so they open only for the people allowed to see them, even by direct link. WordPress stores uploads in /wp-content/uploads/, and every file there is a public URL. Making a page private, or putting your site behind a login, does not protect the files on it: anyone with the link can open them. Birim Private Files routes every request for an uploaded file through WordPress and only serves it to people who are allowed to see it. What you can do with it What it does not do For developers

安装:

  1. Install from Plugins > Add New, or upload the birim-private-files folder to /wp-content/plugins/.
  2. Activate the plugin. Nothing changes until you turn protection on.
  3. Go to Settings > Private Files, tick "Make uploaded files private" and save.
  4. Check the status. On nginx, add the rule shown, reload nginx and click "Check again".

屏幕截图:

  • Share a file with a client from the media library: type their username or email in "Shared with".
  • The "Who can view" box in the page editor: this page is visible only to editors and authors.
  • What a client sees: their "My files" page lists only the files shared with them.

常见问题:

How do I protect PDF files in WordPress?

Activate the plugin, go to Settings > Private Files, tick "Make uploaded files private" and choose who may open files: logged-in users, chosen roles, or only the people each file is shared with. A PDF link then opens only for those people: logged-out visitors are sent to the login page, and logged-in people without access get an error. The status line confirms that direct links are blocked on your server (on nginx, after you add the rule shown).

Will images on my public pages break?

Yes, for logged-out visitors, unless the files match a public exception. This plugin is meant for sites where the content is private too. Use the public exceptions for files that must stay visible, such as a logo.

The status says "Not protected".

Your web server is serving files directly without asking WordPress. On nginx, add the rule shown on the settings page. On Apache, your host may not allow .htaccess rewrite rules, or it may run nginx in front of Apache; send your host the rule shown on the settings page.

The status says "Could not check".

Your server could not make a request to its own website, which some hosts block. Check manually: copy the link of an uploaded file, open a private browser window and paste it. You should see the login page or "This file is private".

Does it slow down my site?

Each file request now starts WordPress to check the login, so files are served a little slower than directly by the web server. Logged-in browsers cache files for an hour.

I use a CDN.

Files are sent with Cache-Control: private, which CDNs respect by default. If your CDN is set to cache everything regardless of headers, exclude /wp-content/uploads/ from that rule.

What happens when I deactivate the plugin?

On Apache the rules are removed and files are public again. On nginx, remove the rule you added, or file links will stop working.

Does it work on multisite?

Not yet. Multisite support is planned.

How do I report a security issue?

Please email security@birim.one instead of posting in the forum. See https://birimone.pages.dev/security/ for the full policy.

更新日志:

1.0.0