Linux 软件免费装
Banner图

Birim REST Lock – Disable REST API & Stop User Enumeration

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

标签

security rest api user enumeration disable rest api wp-json

下载

1.0.0 1.0.1 1.0.2

详情介绍:

Disable the WordPress REST API (/wp-json/) for visitors who are not logged in, and stop user enumeration, without breaking contact forms, WooCommerce or the block editor. A maintained replacement for Disable REST API, with one-click settings import. WordPress exposes a public REST API at /wp-json/. Anyone can list your users, your installed plugins' endpoints and your content. Birim REST Lock closes it without breaking your site. For developers

安装:

  1. Install from Plugins > Add New, or upload the birim-rest-lock folder to /wp-content/plugins/.
  2. Activate the plugin.
  3. Go to Settings > REST Lock to review the routes.

常见问题:

How do I check it works?

Open https://yoursite.com/wp-json/wp/v2/users in your browser. You should get a 401 error. This happens even while you are logged in: WordPress treats a browser visit to /wp-json/ without a security nonce as logged out. The block editor and admin screens send the nonce, so they keep working.

How do I disable the REST API without breaking Contact Form 7?

Install and activate. The default allowlist already lets Contact Form 7, WooCommerce block checkout, oEmbed and Jetpack through, so forms keep sending while everything else in /wp-json/ is closed to logged-out visitors.

A plugin stopped working for visitors.

That plugin calls the REST API for logged-out visitors. Settings > REST Lock lists the namespaces on your site. Add the plugin's namespace (for example /my-plugin/v1) to the allowlist.

Does it block APIs outside /wp-json/?

No. It controls routes registered with the WordPress REST API only.

I'm moving from Disable REST API.

Activate REST Lock and open Settings > REST Lock. Click "Import from Disable REST API", review the result, then deactivate Disable REST API. The import copies the logged-out allowlist and turns roles you managed there into restricted roles. Per-role route lists are not copied; restricted roles share the logged-out rules.

Will it break the block editor?

No. Administrators are never blocked, and other logged-in users are only restricted if you choose their role. Do not restrict roles that write posts.

How do I report a security issue?

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

更新日志:

1.0.2 1.0.1 1.0.0