Disable REST API – WordPress plugin Free download

Click to Download

Disable REST API

Description

** Version 1.4 now supports whitelisting of individual routes within the REST API **

The engine for the API has existed in WordPress since v4.4, but additional functionality and endpoints are a
continual project. While this is very exciting news for many reasons – and many plugins, themes, and even pieces of
WordPress core are already beginning to use the REST API – it is also not functionality that every site admin is going
to want enabled on their website if not necessary.

As of WordPress 4.7, the filters provided for disabling the REST API were removed. To compensate, this plugin will
forcibly return an authentication error to any API requests from sources who are not logged into your website, which
will effectively still prevent unauthorized requests from using the REST API to get information from your website.

For WordPress versions 4.4, 4.5 and 4.6, this plugin makes use of the rest_enabled filter provided by the API to
disable the API functionality. However, it is strongly recommended that all site owners run the most recent version
of WordPress except where absolutely necessary.

Screenshots

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+)

Installation

Upload the disable-json-api directory to the /wp-content/plugins/ directory via FTP
Alternatively, upload the disable-json-api_v#.#.zip file to the ‘Plugins->Add New’ page in your WordPress admin
area
Activate the plugin through the ‘Plugins’ menu in WordPress

FAQ

Installation Instructions

Upload the disable-json-api directory to the /wp-content/plugins/ directory via FTP
Alternatively, upload the disable-json-api_v#.#.zip file to the ‘Plugins->Add New’ page in your WordPress admin
area
Activate the plugin through the ‘Plugins’ menu in WordPress

How do I know if this plugin is working?

While logged into WordPress as any user, the REST API will function as intended. Because of this, you must use a new
browser – or Chrome’s incognito mode – to test your website with a clean session. Go to yourdomain.com/wp-json/ (or
yourdomain.com/?rest_route=/ if you have pretty permalinks disabled) while NOT LOGGED IN to test the results. You will
see an authentication error returned if the plugin is active. “DRA: Only authenticated users can access the REST API.”

Does this plugin disable all REST API’s installed?

This plugin is ONLY meant to disable endpoints accessible via the default REST API that is part of WordPress itself. If
a plugin or theme chooses to register its namespace with the core REST API, its endpoints will – by default – by
disabled so long as this plugin is active. Namespaces and routes may be whitelisted via this plugin’s Settings page.

Reviews

Leave a Reply

Your email address will not be published. Required fields are marked *