Title: Disable REST API for Real
Author: Samuel Aguilera
Published: <strong>2015年12月17日</strong>
Last modified: 2019年11月14日

---

プラグインを検索

![](https://ps.w.org/sar-disable-rest-api/assets/banner-772x250.png?rev=2106977)

このプラグインは **WordPress の最新3回のメジャーリリースに対してテストされていま
せん**。もうメンテナンスやサポートがされていないかもしれず、最新バージョンの WordPress
で使用した場合は互換性の問題が発生する可能性があります。

![](https://ps.w.org/sar-disable-rest-api/assets/icon-128x128.png?rev=2106977)

# Disable REST API for Real

 作者: [Samuel Aguilera](https://profiles.wordpress.org/samuelaguilera/)

[ダウンロード](https://downloads.wordpress.org/plugin/sar-disable-rest-api.2.1.1.zip)

 * [詳細](https://ja.wordpress.org/plugins/sar-disable-rest-api/#description)
 * [レビュー](https://ja.wordpress.org/plugins/sar-disable-rest-api/#reviews)
 * [開発](https://ja.wordpress.org/plugins/sar-disable-rest-api/#developers)

 [サポート](https://wordpress.org/support/plugin/sar-disable-rest-api/)

## 説明

The WordPress REST API is a great resource, but if you don’t want to use it probably
you will want to close this door to your WordPress.

Unlike other popular plugins that aims to disable the REST API but **only return
an error, processed by the REST API**, when a request is received, by default, this
plugin **removes all filters and actions related to WordPress REST API, and returns
a 404 error for requests sent to the REST API URL endpoints, effectively blocking
any use of the REST API**.

Optionally you can set the **REST API setting in Settings -> General page** to “
Logged In Only” for a less drastical action, to keep REST API access enabled but
require the user to be logged in to accept the requests.

If you’re happy with the plugin [please don’t forget to give it a good rating](https://wordpress.org/plugins/sar-disable-rest-api/reviews/?filter=5),
it will motivate me to keep sharing and improving this plugin (and others).

**SUPPORT:** If you have any support question, please [create an issue at the Github repository](https://github.com/samuelaguilera/sar-disable-rest-api/issues).

#### 要件

 * WordPress 4.7 or higher.

#### Features

 * Disable WordPress core REST API **for real** by removing all filters and actions
   related to it and returning a 404 error for requests sent to REST API URL endpoints(
   e.g. https://example.com/wp-json/whatever ).
 * Option to require user to be logged in to use the REST API instead of completely
   disable it.

#### Usage

To disable the REST API completely simply install the plugin from the Plugins page
and enable it.

If you don’t want to disable the REST API but require user to be logged in instead,
go to Settings -> General page and set the REST API to option to “Logged In Only”,
and click Save Changes.

You can change the option back to “Off” if you want to disable the REST API again.

To return to WordPress default, simply deactivate the plugin.

## スクリーンショット

[⌊REST API option in Settings -> General page.⌉⌊REST API option in Settings -> General
page.⌉[

REST API option in Settings -> General page.

[⌊Jetpack's settings page confirming REST API is disabled.⌉⌊Jetpack's settings page
confirming REST API is disabled.⌉[

Jetpack’s settings page confirming REST API is disabled.

## FAQ

  How can I test if the plugin is working?

Use your browser to go to http://example.com/wp-json (replace example.com with your
site domain). Your site will return a 404 error.

You can also check any regular page of your site to confirm the link to the REST
API URL was removed from the HTTP header and from the HTML header.

If you have set the plugin to “Logged In Only”, no changes are made to the page 
headers, but you will receive the following response if you try the REST API without
being logged in:

    ```
    {"code":"rest_not_logged_in","message":"External REST API requests not allowed for this site.","data":{"status":401}}
    ```

## 評価

![](https://secure.gravatar.com/avatar/a9ea1c80a77738d03a2d68b5671566da7bbc9330c98c32ec16d43a3d069a0f63?
s=60&d=retro&r=g)

### 󠀁[works perfectly](https://wordpress.org/support/topic/works-perfectly-341/)󠁿

 [huskehn](https://profiles.wordpress.org/huskehn/) 2016年9月20日

Much easier than editing functions.php. This removed the "Link" HTTP header entirely.
Perfect!

![](https://secure.gravatar.com/avatar/7701881f08ff5e1f1feaacb1f62058b6ec0abc74ef8a69d6e6618d87a12b2963?
s=60&d=retro&r=g)

### 󠀁[Simple to disable REST API](https://wordpress.org/support/topic/simple-to-disable-rest-api/)󠁿

 [sergeymk](https://profiles.wordpress.org/sergeymk/) 2016年9月3日

Thank you for this plug-in, glad I don't have to dig around in WordPress code to
disable the API functionality. I don't use it and don't want another door for potential
exploits.

![](https://secure.gravatar.com/avatar/4fb994b83cf336056a11a1ffd861dcc4f15fc0993fbb18d05e2c440d47ad84e9?
s=60&d=retro&r=g)

### 󠀁[One click plugin](https://wordpress.org/support/topic/one-click-plugin/)󠁿

 [Denis Yanchevskiy](https://profiles.wordpress.org/denisco/) 2016年9月3日

A simple way to disable WordPress REST API.

 [ 3件のレビューをすべて表示 ](https://wordpress.org/support/plugin/sar-disable-rest-api/reviews/)

## 貢献者と開発者

Disable REST API for Real はオープンソースソフトウェアです。以下の人々がこのプラグ
インに貢献しています。

貢献者

 *   [ Samuel Aguilera ](https://profiles.wordpress.org/samuelaguilera/)

“Disable REST API for Real” は2ロケールに翻訳されています。 [翻訳者](https://translate.wordpress.org/projects/wp-plugins/sar-disable-rest-api/contributors)
のみなさん、翻訳へのご協力ありがとうございます。

[“Disable REST API for Real” をあなたの言語に翻訳しましょう。](https://translate.wordpress.org/projects/wp-plugins/sar-disable-rest-api)

### 開発に興味がありますか ?

[コードを閲覧](https://plugins.trac.wordpress.org/browser/sar-disable-rest-api/)
するか、[SVN リポジトリ](https://plugins.svn.wordpress.org/sar-disable-rest-api/)
をチェックするか、[開発ログ](https://plugins.trac.wordpress.org/log/sar-disable-rest-api/)
を [RSS](https://plugins.trac.wordpress.org/log/sar-disable-rest-api/?limit=100&mode=stop_on_copy&format=rss)
で購読してみてください。

## 変更履歴

#### 2.1.1

 * Fixed typo. Thanks to Mike D for reporting it.

#### 2.1

 * Minor changes to make code 100% WordPress Coding Standards compliant.

#### 2.0

 * Added option in Settings -> General page to choose between completely disable
   the REST API (default), or “Logged In Only” to keep REST API access enabled but
   require the user to be logged in to accept the requests.
 * Removed support for WordPress 4.6.1 and older.

#### 1.0

 * 最初のリリース。

## メタ

 *  バージョン **2.1.1**
 *  最終更新日 **7年前**
 *  有効インストール数 **200+**
 *  WordPress バージョン ** 4.7またはそれ以降 **
 *  検証済み最新バージョン: **5.3.26**
 *  言語
 * [Dutch](https://nl.wordpress.org/plugins/sar-disable-rest-api/)、[English (US)](https://wordpress.org/plugins/sar-disable-rest-api/)、
   [German](https://de.wordpress.org/plugins/sar-disable-rest-api/).
 *  [プラグインを翻訳](https://translate.wordpress.org/projects/wp-plugins/sar-disable-rest-api)
 * タグ
 * [api](https://ja.wordpress.org/plugins/tags/api/)[JSON](https://ja.wordpress.org/plugins/tags/json/)
   [rest](https://ja.wordpress.org/plugins/tags/rest/)[rest-api](https://ja.wordpress.org/plugins/tags/rest-api/)
   [wp-json](https://ja.wordpress.org/plugins/tags/wp-json/)
 *  [詳細を表示](https://ja.wordpress.org/plugins/sar-disable-rest-api/advanced/)

## 評価

 5つ星中5つ星

 *  [  3 5-星レビュー     ](https://wordpress.org/support/plugin/sar-disable-rest-api/reviews/?filter=5)
 *  [  0 4-星レビュー     ](https://wordpress.org/support/plugin/sar-disable-rest-api/reviews/?filter=4)
 *  [  0 3-星レビュー     ](https://wordpress.org/support/plugin/sar-disable-rest-api/reviews/?filter=3)
 *  [  0 2-星レビュー     ](https://wordpress.org/support/plugin/sar-disable-rest-api/reviews/?filter=2)
 *  [  0 1-星レビュー     ](https://wordpress.org/support/plugin/sar-disable-rest-api/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/sar-disable-rest-api/reviews/#new-post)

[すべてのレビューを見る](https://wordpress.org/support/plugin/sar-disable-rest-api/reviews/)

## 貢献者

 *   [ Samuel Aguilera ](https://profiles.wordpress.org/samuelaguilera/)

## サポート

意見や質問がありますか ?

 [サポートフォーラムを表示](https://wordpress.org/support/plugin/sar-disable-rest-api/)