Title: Secure Private Files
Author: Ankit Patel
Published: <strong>2026 年 1 月 23 日</strong>
Last modified: 2026 年 9 月 16 日

---

搜索插件

![](https://ps.w.org/ankit-secure-private-files/assets/banner-772x250.png?rev=3459085)

![](https://ps.w.org/ankit-secure-private-files/assets/icon-256x256.png?rev=3445564)

# Secure Private Files

 作者：[Ankit Patel](https://profiles.wordpress.org/ankitpatel1578/)

[下载](https://downloads.wordpress.org/plugin/ankit-secure-private-files.1.0.7.zip)

 * [详情](https://cn.wordpress.org/plugins/ankit-secure-private-files/#description)
 * [评价](https://cn.wordpress.org/plugins/ankit-secure-private-files/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/ankit-secure-private-files/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/ankit-secure-private-files/#developers)

 [支持](https://wordpress.org/support/plugin/ankit-secure-private-files/)

## 描述

**Secure Private Files** allows you to securely manage and share private files with
selected users or user roles in WordPress.

Files are protected using **unique token-based URLs**, ensuring they cannot be accessed
without proper permission. You can define **who can download each file**, set an**
expiry date**, and track **download activity**.

[YouTube Tutorials](https://www.youtube.com/@ankitpateltechlabs) | [Free Support](https://wordpress.org/support/plugin/ankit-secure-private-files)

This plugin is ideal for:
 – Membership sites – Client portals – Secure document
sharing – Restricted downloads – Private resources for logged-in users

### Key Features

 * Secure token-based file access (no public URLs)
 * Assign files to **specific users**
 * Allow access by **user roles**
 * Optional **expiry date** for each file
 * Logged-in user verification
 * Download activity logging (user, IP, date)
 * Dedicated **Private Files** custom post type
 * Media library integration for file selection
 * AJAX-powered user search (Select2)
 * Frontend shortcode to list accessible files
 * Works with any WordPress theme
 * No third-party dependency required

### How It Works

 1. Admin creates a **Private File** post
 2. Uploads or selects a file from Media Library
 3. Assigns allowed users and/or roles
 4. (Optional) Sets an expiry date
 5. Plugin generates a secure download token
 6. Authorized users can download the file using the secure link

### Shortcodes

**List logged-in user’s available private files**
 [secure_files]

Displays only files the current user is allowed to access.

## 屏幕截图

[⌊Private Files custom post type in admin⌉⌊Private Files custom post type in admin⌉[

Private Files custom post type in admin

## 安装

 1. Upload the plugin folder to `/wp-content/plugins/`
 2. Activate **Secure Private Files**
 3. Go to **Private Files** in the admin menu
 4. Add a new Private File
 5. Select file, users, roles, and expiry
 6. Use the shortcode on any page if needed

## 常见问题

### Is login required to download files?

Yes. Only logged-in users with permission can access files.

### Can I restrict files by user role?

Yes. You can allow access by user roles and/or specific users.

### Are files accessible via direct URL?

No. Files are protected using secure token-based URLs.

### Does the plugin log downloads?

Yes. Each download logs the user, IP address, and date.

### Will this work with any theme?

Yes. It works independently of themes and page builders.

### Is WooCommerce required?

No. WooCommerce is NOT required.

## 评价

此插件暂无评价。

## 贡献者及开发者

「Secure Private Files」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Ankit Patel ](https://profiles.wordpress.org/ankitpatel1578/)
 *   [ Hardik Raval ](https://profiles.wordpress.org/hardik2221/)

「Secure Private Files」插件已被翻译至 2 种本地化语言。 感谢[所有译者](https://translate.wordpress.org/projects/wp-plugins/ankit-secure-private-files/contributors)
为本插件所做的贡献。

[帮助将「Secure Private Files」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/ankit-secure-private-files)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/ankit-secure-private-files/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/ankit-secure-private-files/)，或
通过[RSS](https://plugins.trac.wordpress.org/log/ankit-secure-private-files/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/ankit-secure-private-files/)。

## 更新日志

#### 1.0.7

 * Added a Docs page under Secure Private Files with shortcode instructions
 * Improved [secure_files] frontend layout with responsive file cards
 * Added file type, size, expiry information, and secure Download buttons
 * Expired files are hidden from the frontend list
 * Added secure, sanitized dynamic frontend display fields to the Docs page
 * Added customizable eyebrow, title, description, available count, download label,
   and empty-state text
 * Dynamic display settings affect presentation only and never bypass file access
   controls

#### 1.0.6

 * Compatibility : WordPress 7.1

#### 1.0.5

 * Security fix: protected files were previously stored as normal media
    attachments
   under wp-content/uploads/, making them directly downloadable via their public
   URL and enumerable via the unauthenticated /wp/v2/media REST endpoint, bypassing
   all login/role/expiry checks. Protected files are now relocated on save into 
   a dedicated directory that is denied at the web-server level (.htaccess / web.
   config), are excluded from REST API media responses, and existing sites are migrated
   automatically on upgrade.

#### 1.0.4

 * Compatibility : WordPress 7.0

#### 1.0.3

 * Short Code Impovements
 * Few minor bugfix and improvements

#### 1.0.2

 * Code Impovements
 * Language POT
 * Few minor bugfix and improvements

#### 1.0.1

 * slug update

#### 1.0

 * Initial release
 * Secure token-based downloads
 * User and role-based access control
 * Expiry date support
 * Download logs
 * Frontend shortcode support

## 额外信息

 *  版本 **1.0.7**
 *  最后更新：**4 周前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 6.0 或更高版本 **
 *  已测试的最高版本为 **7.1.3**
 *  PHP 版本 ** 7.4 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/ankit-secure-private-files/) 、 
   [Gujarati](https://gu.wordpress.org/plugins/ankit-secure-private-files/) 和 [Hindi](https://hi.wordpress.org/plugins/ankit-secure-private-files/).
 *  [翻译成简体中文](https://translate.wordpress.org/projects/wp-plugins/ankit-secure-private-files)
 * 标签
 * [access-control](https://cn.wordpress.org/plugins/tags/access-control/)[download manager](https://cn.wordpress.org/plugins/tags/download-manager/)
   [file manager](https://cn.wordpress.org/plugins/tags/file-manager/)[membership](https://cn.wordpress.org/plugins/tags/membership/)
   [security](https://cn.wordpress.org/plugins/tags/security/)
 *  [高级视图](https://cn.wordpress.org/plugins/ankit-secure-private-files/advanced/)

## 评级

尚未提交反馈。

[您的评价](https://wordpress.org/support/plugin/ankit-secure-private-files/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/ankit-secure-private-files/reviews/)

## 贡献者

 *   [ Ankit Patel ](https://profiles.wordpress.org/ankitpatel1578/)
 *   [ Hardik Raval ](https://profiles.wordpress.org/hardik2221/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/ankit-secure-private-files/)