WPThumbs
Themes Plugins By purpose By industry Best-of lists Fix it guides
Free Plugin by Sean Fisher v1.4.1

REST API Guard

Restrict and control access to the REST API.

REST API Guard

The facts

Rating
5★ from 2
Active installs
100+
Price
Free
Last updated
9 Sep 2025
Added
Oct 2022
Requires WP
6.5
Tested up to
WP 6.8.8
Requires PHP
8.1
Downloads
4,113

Our analysis

AI-assisted

REST API Guard is a WordPress plugin designed to control and restrict access to the REST API on your site. It allows you to disable anonymous access and manage permissions based on specific namespaces or paths. This is particularly useful for site owners who want to enhance security by limiting the exposure of their site's data through the REST API.

The plugin features a settings page for easy configuration, where you can adjust access controls for user information and various endpoints. It is suitable for users who require tighter security measures for their WordPress installations, particularly those handling sensitive data or looking to prevent unwanted access to their API.

Best for: This plugin suits WordPress site owners looking to enhance their API security.

What it does well

  • Disables anonymous access to the REST API
  • Allows restriction by namespace and path
  • Configurable through a settings page
  • Restricts access to user information by default
  • Compatible with PHP 8.1

Where it falls short

  • Limited information on additional features or customisation options

Verdict

REST API Guard provides essential tools for managing REST API access, making it a practical choice for those prioritising security in their WordPress sites.

From the developer

Sean Fisher's own description of REST API Guard, lightly tidied.

Restrict and control access to the REST API.

Usage

The WordPress REST API is generally very public and can share a good deal of information with the internet anonymously. This plugin aims to make it easier to restrict access to the REST API for your WordPress site.

Out of the box the plugin can:

  • Disable anonymous access to the REST API.
  • Restrict and control anonymous access to the REST API by namespace, path, etc.

Settings Page

The plugin can be configured via the Settings page (Settings -> REST API Guard) or via the relevant filter.

Preventing Access to User Information (wp/v2/users)

By default, the plugin will restrict anonymous access to the users endpoint. This can be prevented in the plugin’s settings or via code:

add_filter( 'rest_api_guard_allow_user_access', fn () => true );

Preventing Access to Index (/) or Namespace Endpoints (wp/v2)

To prevent anonymous users from browsing your site and discovering what plugins/post types are setup, the plugin restricts access to the index (/) and namespace (wp/v2) endpoints. This can be prevented in the plugin’s settings or via code:

// Allow index access.
add_filter( 'rest_api_guard_allow_index_access', fn () => true );

// Allow namespace access.
add_filter( 'rest_api_guard_allow_namespace_access', fn ( string $namespace ) => true );

Restrict Anonymous Access to the REST API

The plugin can restrict anonymous access for any request to the REST API in the plugin’s settings or via code:

add_filter( 'rest_api_guard_prevent_anonymous_access', fn () => true );

Read the full description on the official page →

Tagged as

Alternatives

Other plugins for integrating services.

LocoAI

LocoAI

89

LocoAI - Auto Translate For Loco Translate is a powerful tool for developers looking to quickly translate thei...

Free 70k+ installs 4.9★ (637)
Uncanny Automator

The AI + Automation plugin for WordPress. Automate workflows across all your plugins and apps, add an AI agent...

Free 40k+ installs 4.9★ (156)
Open User Map

Create custom interactive maps with free Leaflet-based styles, no Google Maps API key, frontend marker submiss...

Free 10k+ installs 5★ (67)
Activity Log

Monitor every change on your WordPress site — who did what, when, and where it came from — for a complete audi...

Free 200k+ installs 4.3★ (74)
Reviews Feed

No API key required. Display Yelp and Google reviews for any business in a clean, customizable feed on your si...

Free 100k+ installs 4.4★ (34)
Bit integrations

Contact Form, Google Sheet, MailChimp, Brevo, Webhook, Zoho CRM Automation and Integration plugin that Connect...

Free 20k+ installs 4.9★ (160)