Title: TR Register Only
Author: techieresource
Published: <strong>2013 年 12 月 21 日</strong>
Last modified: 2026 年 3 月 1 日

---

搜索插件

![](https://ps.w.org/tr-register-only/assets/banner-772x250.png?rev=3472250)

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://ps.w.org/tr-register-only/assets/icon-128x128.png?rev=3472250)

# TR Register Only

 作者：[techieresource](https://profiles.wordpress.org/techieresource/)

[下载](https://downloads.wordpress.org/plugin/tr-register-only.2.0.0.zip)

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

 [支持](https://wordpress.org/support/plugin/tr-register-only/)

## 描述

**TR Register Only** makes your entire WordPress site private. Once enabled, only
logged-in users can access any page, post, or custom post type. Everyone else is
redirected to the login page (or a custom URL of your choice).

**Key Features:**

 * ✅ One-click enable/disable toggle
 * 🔒 Role-based access control — set minimum required user role
 * ↩️ Redirect to WordPress login page or any custom URL
 * 💬 Custom message shown on the login page
 * 📋 Whitelist specific pages for public access (e.g. pricing, landing pages)
 * 🏠 Optionally whitelist the home/front page
 * 📡 Optionally restrict REST API to authenticated users
 * 🧹 Clean uninstall — removes all data when deleted

**Perfect for:**

 * Private/members-only communities
 * Staging and development sites
 * Corporate intranets
 * Schools and educational platforms
 * Subscription-based content sites

## 安装

 1. Upload the `tr-register-only` folder to `/wp-content/plugins/`
 2. Activate the plugin from **Plugins > Installed Plugins**
 3. Go to **Settings > TR Register Only** to configure

## 常见问题

### Will this lock me out of the admin?

No. The WordPress login page (`wp-login.php`) is always whitelisted automatically,
so you can always log in.

### Can I allow some pages to be publicly accessible?

Yes. In Settings, enter the page IDs you want to keep public under “Whitelisted 
Page IDs”. Separate multiple IDs with commas.

### Does this protect the REST API too?

Optionally. Enable “Protect REST API” in settings to require authentication on all
REST endpoints. Note this may break plugins that rely on unauthenticated API calls.

### How do I find a page’s ID?

Go to Pages > All Pages, hover over a page, and the ID appears in the URL at the
bottom of the browser (e.g. `post=42`).

## 评价

此插件暂无评价。

## 贡献者及开发者

「TR Register Only」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ techieresource ](https://profiles.wordpress.org/techieresource/)

[帮助将「TR Register Only」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/tr-register-only)

### 对开发感兴趣吗?

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

## 更新日志

#### 2.0.0

 * Complete rewrite for modern WordPress 6.x compatibility
 * Added role-based access control (minimum role setting)
 * Added custom URL redirect option
 * Added page whitelist feature
 * Added home page whitelist option
 * Added REST API protection option
 * Added custom login message support
 * Added clean uninstall (removes options on delete)
 * PHP 8.x compatible
 * Singleton pattern with proper OOP architecture
 * Full input sanitization and escaping

#### 1.0

 * Initial release

## 额外信息

 *  版本 **2.0.0**
 *  最后更新：**3 月前**
 *  活跃安装数量 **20+**
 *  WordPress 版本 ** 5.6 或更高版本 **
 *  已测试的最高版本为 **6.7.5**
 *  PHP 版本 ** 7.4 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/tr-register-only/)
 * 标签
 * [login](https://cn.wordpress.org/plugins/tags/login/)[members-only](https://cn.wordpress.org/plugins/tags/members-only/)
   [private](https://cn.wordpress.org/plugins/tags/private/)[registration](https://cn.wordpress.org/plugins/tags/registration/)
   [restrict](https://cn.wordpress.org/plugins/tags/restrict/)
 *  [高级视图](https://cn.wordpress.org/plugins/tr-register-only/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  3 条 5 星评价     ](https://wordpress.org/support/plugin/tr-register-only/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/tr-register-only/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/tr-register-only/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/tr-register-only/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/tr-register-only/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/tr-register-only/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/tr-register-only/reviews/)

## 贡献者

 *   [ techieresource ](https://profiles.wordpress.org/techieresource/)

## 支持

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

 [查看支持论坛](https://wordpress.org/support/plugin/tr-register-only/)