MaxtDesign

Disable REST API

Full REST API control. Per-role. Zero frontend footprint.

Block, restrict, or whitelist WordPress REST API endpoints per user role. Auto-discovers endpoints, smart defaults for CF7 and WooCommerce, import/export settings. Zero frontend footprint.

10+ installs
WP 6.4+
PHP 8.2+
Disable REST API: Full REST API control. Per-role. Zero frontend footprint.
Open Source

Features

What Disable REST API Does

Built for performance, designed for simplicity.

One-click disable — block all REST API access for unauthenticated users
Endpoint whitelist — auto-discovers all registered REST API endpoints
Collapsible namespace tree with Select All / Deselect All per namespace
Per-role access control — restrict specific roles with individual whitelists
Smart defaults — auto-detects CF7 and WooCommerce and whitelists their endpoints
Custom error message for blocked requests (configurable)
Zero frontend footprint — no CSS, JS, or HTTP requests on public pages
Admin assets load only on the plugin settings page
Single autoloaded database option — no extra queries on any request
Import/Export settings as JSON for multi-site deployment
Reset to defaults with confirmation dialog
Clean uninstall — removes all data including multisite cleanup
Uses rest_authentication_errors filter — blocked requests exit before endpoint logic
Translation-ready with .pot file included

Overview

Why Disable REST API?

By default, WordPress exposes a REST API to the public that can reveal usernames, post data, and site structure to anyone. MaxtDesign Disable REST API gives you complete control over who can access the API and which endpoints are available.

The plugin uses the rest_authentication_errors filter — the correct, modern WordPress approach — to intercept REST API requests early in the lifecycle, before any endpoint logic executes. Blocked requests have virtually zero performance impact. It auto-discovers all registered REST API endpoints and presents them in a collapsible namespace tree with per-namespace and per-route checkboxes.

Smart defaults detect Contact Form 7 and WooCommerce on activation and automatically whitelist their required endpoints. Per-role controls let you restrict specific user roles (subscriber, contributor, author) while keeping full access for administrators. Each restricted role gets its own endpoint whitelist.

Zero frontend footprint means no CSS, no JavaScript, and no HTTP requests are added to your public-facing pages. Admin assets load only on the plugin's own settings page. A single autoloaded database option means no extra queries. Settings can be exported as JSON and imported on other sites.

Requirements

  • WordPress 6.4 or higher
  • PHP 8.2 or higher

FAQ

Frequently Asked Questions

Can't find what you're looking for? Check the documentation or open an issue on GitHub.

Changelog

What's New

v1.0.22026-05-28
  • CRITICAL FIX: the REST API root index (/wp-json/) is now blocked when "Disable REST API for unauthenticated users" is on. Previously, the controller's route-lookup returned an empty string for the root index and the code took an early fail-open branch — meaning the most-scraped discovery URL was always exposed even when the plugin was active. Logged-out visitors and unauthenticated scrapers now hit the configured error response on /wp-json/ like any other endpoint
v1.0.12026-05-28
  • WordPress 7.0 "Armstrong" compatibility confirmed
  • Hardening: import-settings now validates uploads with is_uploaded_file() and reads the temp file directly instead of mis-sanitising the server-generated path
  • Hardening: activation hook defensively loads wp-admin/includes/plugin.php before calling is_plugin_active() so WP-CLI and multisite bulk-activate paths can't fatal
  • Fix: the "this plugin requires REST API access" compatibility notice no longer fires for plugins whose namespaces aren't actually registered on the site (e.g. WooCommerce installed but Store API blocks not loaded)
v1.0.02025-04-10
  • Initial release
  • Global REST API toggle for unauthenticated users
  • Auto-discovery of all registered REST API endpoints
  • Endpoint whitelisting with collapsible namespace tree
  • Per-role REST API access controls with individual whitelists
  • Smart defaults for Contact Form 7 and WooCommerce
  • Custom error message configuration
  • Settings import/export as JSON
  • Reset to defaults with confirmation
  • Clean uninstall with multisite support

Documentation & Support

Step-by-step guides, configuration help, and issue tracking on GitHub.

Open Source on GitHub

View the source, report bugs, or contribute. This plugin is free and open source under the GPL.

Need Something Custom?

We build custom WordPress plugins tailored to your exact requirements.