跳到内容

Disable REST API

v1.8

Dave McHale · 2014年10月3日 上架

Disable the use of the REST API on your website to site users. Now with User Role support!

正在使用
8 万+
评分
4.8 / 5
累计下载
80 万
最近更新
2023年9月14日
38 条评价需要 WordPress 4.9+已测试到 6.3.15PHP 5.6+

截图

The JSON returned by a website with the API disabled via filters (WP versions 4.4, 4.5, 4.6)
The JSON returned by a website with the API disabled via filters (WP versions 4.4, 4.5, 4.6)
The JSON returned by a website with the API disabled via authentication methods (WP versions 4.7+)
The JSON returned by a website with the API disabled via authentication methods (WP versions 4.7+)
The Settings page lets you selectively whitelist endpoints registered with the REST API, on a per-user-role basis.
The Settings page lets you selectively whitelist endpoints registered with the REST API, on a per-user-role basis.

The most comprehensive plugin for controlling access to the WordPress REST API!

Works as a “set it and forget it” install. Just upload and activate, and the entire REST API will be inaccessible to your general site visitors.

But if you do need to grant access to some endpoints, you can do that too. Go to the Settings page and you can quickly whitelist individual endpoints (or entire branches of endpoints) in the REST API.

You can even do this on a per-user-role basis, so your unauthenticated users have one set of rules while WooCommerce customers have another while Subscribers and Editors and Admins all have their own. NOTE: Out of the box, all defined user roles will still be granted full access to the REST API until you choose to manage those settings.

For most versions of WordPress, this plugin will return an authentication error if a user is not allowed to access an endpoint. For legacy support, WordPress 4.4, 4.5, and 4.6 use the provided rest_enabled filter to disable the entire REST API.

Plums

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

导航

说明

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

© 2026 Plums