🔥 Black Friday Sale: Get 65% OFF Any PageForge Pro Plan! Use code BF65 Claim Offer →
Compte Get it free
REST API Guard icon
Activement maintenu Testé avec WP 7.1 #43 in authentication

REST API Guard

Restrict and control anonymous access to the WordPress REST API, with optional JSON Web Token (JWT) authentication.

Installations actives200+100+ niveaux
Téléchargements · 30D455▼ -5.2% vs prev. 30d
Évaluation5/52 avis
Score de santé72/100Bon
Téléchargements de tous les temps5.3KSince Oct 2022
Support résolu—Aucun fil de discussion récent
A besoin deWP 6.5PHP 8.3+
Téléchargements · 7j100▼ -2.9% week over week
Notre verdict

Choix solide

REST API Guard is a solid plugin choice in 2026, with a few things worth checking first. It runs on 200+ sites, is rated 5/5 and was last updated 2 months ago, and scores 72/100 on our health check.

  • Testé avec le dernier WordPress (7.1)
  • Petite base d'utilisateurs (plus de 200 installations actives)
  • Très peu de critiques jusqu'à présent
  • Nécessite PHP 8.3 ou plus récent

Comment s'accumule-t-il ?

Côte à côte sur les installations, les mises à jour, les évaluations et le support

Téléchargements quotidiens

224466Aug 31Oct 14Nov 28
Hier15
Moyenne quotidienne (1 ans)5
Jour de pointe8913 Octobre 2026
12 Derniers mois2K

Les pics de téléchargement suivent généralement une nouvelle version - chaque site qui met à jour automatiquement compte comme un téléchargement.

Classements

Where REST API Guard stands today

WordPress.org Classements de recherche

Position en direct dans la recherche de plugins, Top 100
Mot-cléPositionPlugins concurrentsCatégorie
authentication >100 5,038 Best authentication plugins →
jwt #10 326 Best jwt plugins →
intimité >100 10,000 Meilleurs plugins de confidentialité →
API REST #14 10,000 Meilleurs plugins REST-API →
la sécurité >100 10,000 Meilleurs plugins de sécurité →

Adoption de version

Part de sites actifs par version.

  • 1.554.2%
  • 1.432.9%
  • 1.312.9%

Répartition des notes

★★★★★ ★★★★★ 5 sur 2 avis

  • 5★100.0%
  • 4★0.00%
  • 3★0.00%
  • 2★0.00%
  • 1★0.00%

About REST API Guard

À partir du Lisezmoi officiel · v1.5.0

Description

The WordPress REST API is public by default and shares a good deal of information about your site with anyone who asks. REST API Guard makes it easy to decide who can see what.

Out of the box, the plugin:

  • Blocks anonymous access to the users endpoint (/wp/v2/users) so usernames aren’t exposed.
  • Blocks anonymous access to the REST API index (/) and namespace endpoints (/wp/v2) so visitors can’t list your plugins and post types.

It can also:

  • Block all anonymous access to the REST API.
  • Allow anonymous access only to specific routes (allowlist), or block specific routes (denylist).
  • Require anonymous requests to include a JSON Web Token (JWT).
  • Let users authenticate with a JWT tied to their account.
  • Generate, list, and revoke tokens from the settings page or WP-CLI.

Every option is available on the settings page (Settings → REST API Guard) and as a filter for configuring the plugin in code. A setting controlled by a filter is shown as read-only on the settings page.

Restrict access to user information

Anonymous access to /wp/v2/users is blocked by default. To allow it:

add_filter( 'rest_api_guard_allow_user_access', '__return_true' );

Restrict access to the index and namespace endpoints

Anonymous access to the index (/) and namespace (/wp/v2) endpoints is blocked by default. To allow it:

add_filter( 'rest_api_guard_allow_index_access', '__return_true' );
add_filter( 'rest_api_guard_allow_namespace_access', '__return_true' );

Block all anonymous access

add_filter( 'rest_api_guard_prevent_anonymous_access', '__return_true' );

Allow anonymous access to specific routes (allowlist)

When an allowlist is set, anonymous requests to any route not on the list are denied. The allowlist takes priority over the denylist. Use * as a wildcard.

add_filter(
    'rest_api_guard_anonymous_requests_allowlist',
    fn () => [
        '/wp/v2/posts*',
        '/custom-namespace/v1/public/*',
    ]
);

Deny anonymous access to specific routes (denylist)

Anonymous requests to routes on the denylist are denied. All other routes are allowed. Use * as a wildcard.

add_filter(
    'rest_api_guard_anonymous_requests_denylist',
    fn () => [
        '/wp/v2/comments*',
        '/custom-namespace/v1/private/*',
    ]
);

Require a JSON Web Token (JWT) for anonymous requests

Anonymous requests can be required to send a token in an Authorization: Bearer <token> header:

add_filter( 'rest_api_guard_authentication_jwt', '__return_true' );

Tokens are expected to have an audience of wordpress-rest-api and an issuer of the site URL. Both can be changed:

add_filter( 'rest_api_guard_jwt_audience', fn () => 'custom-audience' );
add_filter( 'rest_api_guard_jwt_issuer', fn () => 'https://example.com' );

Tokens are signed with a secret generated automatically and stored in the rest_api_guard_jwt_secret option. It can also be set in code:

add_filter( 'rest_api_guard_jwt_secret', fn () => 'my-custom-secret' );

Authenticate users with a JWT

Tokens can also be tied to a user. A request with a user token is treated as that user, with the same permissions they have:

add_filter( 'rest_api_guard_user_authentication_jwt', '__return_true' );

Generate, list, and revoke tokens

Once JWT authentication is enabled, tokens can be generated from the Tokens tab of the settings page. Give each one a name so you can tell them apart later, and optionally tie it to a user or set an expiration. The token is shown once after it’s generated, so copy it somewhere safe.

The same tab lists every token the plugin has issued, and any of them can be revoked. A revoked token stops working right away.

Tokens can also be managed with WP-CLI:

wp rest-api-guard generate-jwt [--name=<name>] [--user=<user-id>] [--expiration=<seconds>]
wp rest-api-guard list-jwts
wp rest-api-guard revoke-jwt <id>

Or generated in code:

$token = \Alley\WP\REST_API_Guard\generate_jwt(
    expiration: HOUR_IN_SECONDS, // Optional. Seconds until the token expires.
    user: 1,                     // Optional. A user ID or WP_User.
    name: 'Mobile App',          // Optional. A name to identify the token by.
);

Tokens issued before version 1.5.0 aren’t tracked, so they can’t be listed or revoked one at a time. They’re still accepted by default. To reject them:

add_filter( 'rest_api_guard_allow_untracked_jwt', '__return_false' );

Changing the rest_api_guard_jwt_secret option invalidates every token issued so far, tracked or not.

Mise en cache

Responses to REST API requests that include an Authorization header are sent with no-cache headers so a page cache or CDN doesn’t store them.

Installation

  1. Install the plugin from the Plugins → Add New screen, or upload it to the /wp-content/plugins/ directory.
  2. Activate the plugin from the Plugins screen.
  3. Configure it from Settings → REST API Guard.

The plugin can also be installed with Composer:

composer require alleyinteractive/wp-rest-api-guard

Journal de modifications

1.5.0

  • Track issued JWTs and allow them to be revoked from the settings page or WP-CLI.
  • Add a Tokens tab to the settings page to generate, list, and revoke JWTs when JWT authentication is enabled.
  • Add the rest_api_guard_allow_untracked_jwt filter to reject JWTs issued before tracking.
  • Send no-cache headers on REST API requests that include an Authorization header.

1.4.2

  • Prevent mixed-case REST API routes from bypassing anonymous access restrictions.
  • Add support for WordPress 7.1.
  • Require PHP 8.3+.
  • Update firebase/php-jwt to version 7.

1.4.1

  • No changes, release to trigger deployment to WordPress.org.

1.4.0

  • Add support for WordPress 6.8.
  • Require PHP 8.1+.

1.3.1

  • Ignore JWT authentication for the REST API if the user is already authenticated.

1.3.0

  • Allow claims to be added to a generated JWT via filter.
  • Don’t check OPTIONS requests by default.

Journal des modifications complet sur WordPress.org →

Captures d'écran

The settings page.
The settings page.
The Tokens tab for generating, listing, and revoking JSON Web Tokens.
The Tokens tab for generating, listing, and revoking JSON Web Tokens.

Pour les développeurs

Est-ce votre plugin ? Montrez les chiffres.

Ajoutez un badge en direct à votre site, docs ou github readme. Il se met à jour par lui-même - aucun compte n'est nécessaire.

Badge d'installations actives Badge Badge de score de santé

Best REST API Guard alternatives

All authentication plugins →
Alternatives
Rang Plugin Installations actives Évaluation Mise à jour Santé
1 Limiter les tentatives de connexion Limiter les tentatives de connexion Limitez le taux de tentatives de connexion, y compris au moyen de cookies, pour chaque IP. Entièrement personnalisable. par Automattic 200K+ ★★★★★★★★★★ 4.6 (202) Il y a 4 ans 47
2 Deux facteurs Deux facteurs Activez l'authentification à deux facteurs (2FA) à l'aide de mots de passe uniques basés sur le temps (TOTP), e-mail… par WordPress.org 100K+ ★★★★★★★★★★ 4.8 (209) Il y a 2 mois 91
3 Connexion à la limite de WPS Connexion à la limite de WPS WPS limiter la connexion limite les tentatives de connexion par adresse IP par Nicolaskulka 100K+ ★★★★★★★★★★ 4.9 (83) Il y a 2 semaines 81
4 WP-Members Membership Plugin WP-Members Membership Plugin The original WordPress membership plugin with content restriction, user login, custom… by Chad Butler 50K+ ★★★★★★★★★★ 4.6 (272) il y a 1 mois 79
5 Google Authenticator Google Authenticator Two-factor authentication for WordPress using Google Authenticator or any other time-based… by Ivan 20K+ ★★★★★★★★★★ 4.3 (135) Il ya 3 jours 87
6 WP Limit Login Attempts WP Limit Login Attempts Limit rate of login attempts and block IP temporarily. Brute force attack protection. GDPR… par Arshid 10K+ ★★★★★★★★★★ 4.6 (300) Il y a 3 mois 84
7 Login for Google Apps by WPAuth Login for Google Apps by WPAuth Simple secure login and user management through your Google Workspace for WordPress (using… de Syed Balkhi 10K+ ★★★★★★★★★★ 4.6 (64) Il y a 2 mois 84
8 Login by Auth0 Login by Auth0 Login by Auth0 provides improved username/password login, Passwordless login, Social login… by Auth0 10K+ ★★★★★★★★★★ 3.1 (18) Il y a 2 ans 34
9 Two Factor (2FA) Authentication via Email Two Factor (2FA) Authentication via Email Enable one-click login with this WordPress Two-Factor Authentication (2FA) plugin… par Sully 9K+ ★★★★★★★★★★ 5 (4) il y a 1 mois 79
10 Authorizer Authorizer Authorizer limits login attempts, restricts access to specific users, and authenticates… by Paul Ryan 8K+ ★★★★★★★★★★ 5 (20) il y a 1 semaine 78

FAQ

REST API Guard: quick answers

Réponses directes, extraites des données en direct WordPress.org.

Source : WordPress.org

Is REST API Guard free?

Yes. REST API Guard is free to download and use from the official WordPress.org plugin directory.

Is REST API Guard safe to use in 2026?

REST API Guard is a solid plugin choice in 2026, with a few things worth checking first. It runs on 200+ sites, is rated 5/5 and was last updated 2 months ago, and scores 72/100 on our health check.

How many websites use REST API Guard?

REST API Guard is active on 200+ WordPress websites and has been downloaded 5,313 times since it launched in October 2022. It was downloaded 455 times in the last 30 days.

Does REST API Guard work with WordPress 7.1?

Yes. The developer has tested REST API Guard up to WordPress 7.1.5, the latest release. It requires WordPress 6.5 or newer.

What PHP version does REST API Guard need?

REST API Guard requires PHP 8.3 or higher. Most hosts run PHP 8.x today, so it works on any modern WordPress hosting.

When was REST API Guard last updated?

The latest version, 1.5.0, was released on October 13, 2026 (2 months ago).

Who makes REST API Guard?

REST API Guard is developed and maintained by Sean Fisher.

What are the best alternatives to REST API Guard?

The most popular alternatives to REST API Guard are Limit Login Attempts (200K+ installs), Two Factor (100K+ installs) and WPS Limit Login (100K+ installs).

Propulsé par PageForge

Un modèle et une feuille de calcul. Une vraie page pour chaque recherche.

PageForge transforme chaque ligne d'un CSV en une page WordPress avec son propre titre, URL, SEO et schéma, construit sur la mise en page que vous Déjà conçu. Gratuit sur WordPress.org.

  • CSV et XLSX, plus Google Sheets sur les professionnels et les entreprises
  • Son propre titre, URL, SEO champs et schéma pour chaque page
  • Fonctionne avec l'éditeur de blocs, Elementor, Divi et Avada
  • Gratuit sur WordPress.org, pas de carte de crédit

↑↓ bouger↵ ouvrir