跳到内容

Birim REST Lock – Disable REST API & Stop User Enumeration

v1.0.1

Melih Birim · 2026年10月30日 上架

Disable the REST API for logged-out visitors without breaking forms or the editor. Stop user enumeration. One-click import from Disable REST API.

正在使用
10 以下
评分
暂无
累计下载
407
最近更新
2026年11月23日
需要 WordPress 6.0+已测试到 7.1.5PHP 7.4+

贡献者

截图

Settings > REST Lock: choose a mode, list routes with wildcards, restrict roles and hide user and route listings.
Settings > REST Lock: choose a mode, list routes with wildcards, restrict roles and hide user and route listings.

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.

  • Allowlist mode (default): block every route except the ones you list.
  • Blocklist mode: allow every route except the ones you list.
  • Wildcards: /wp/v2/posts* covers /wp/v2/posts and /wp/v2/posts/123.
  • Role rules: apply the same rules to logged-in roles you choose, such as subscribers or customers. Administrators are never blocked.
  • Stop username enumeration: always block /wp/v2/users.
  • Hide what you run: block the route index and namespace listings, and remove REST links from page HTML, the Link header and RSD.
  • Safe defaults: Contact Form 7, WooCommerce block checkout, oEmbed and Jetpack routes are allowed out of the box. CORS preflight (OPTIONS) requests pass through, so token logins keep working.
  • One-click import from Disable REST API: moves your logged-out allowlist and managed roles across.
  • Lightweight: one file, works on PHP 7.4 and up, no tracking, no external requests, no ads.

For developers

  • birim_rest_lock_blocked filter: ( bool $blocked, string $route, WP_REST_Request $request ) to override the decision.
  • birim_rest_lock_message filter: change the error message.

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums