REST Guard
Limit the REST API to logged-in users, keep needed routes open, and stop strangers listing your user names.
Coming to WordPress.org soon
WordPress answers REST API requests from anyone, so a bot can read your user names at /wp-json/wp/v2/users. REST Guard hides that list and can close the API to visitors, while routes that forms and carts need stay open.
The block editor and everything you do while logged in keep working. Editors and authors still get the author list the editor needs.
What the free version does
- Open, logged-in only, or logged-in only plus allowed routes
- Allowed routes ready for common plugins such as Contact Form 7 and the WooCommerce cart
- Hide the users list from visitors and subscribers
- Stop ?author=1 scans and keep names out of the users sitemap and oEmbed
- Remove the REST links from the page head
Pro
The free version is complete on its own. Pro adds:
- Role rules: treat chosen roles like visitors.
- Blocked request log: the last 500, with shortened IP addresses.
- Rate limit: cap anonymous requests per minute.
- Closed routes: turn off a route for everyone but admins.
Privacy
The free version stores nothing and makes no outside requests. The Pro log keeps the last 500 blocked requests with their route and time, and only a shortened IP address.
Questions
Will it break the block editor?
No. Logged-in requests are always allowed.
A form stopped working for visitors.
Its route needs allowing. In your browser's developer tools find the request to /wp-json/ that fails with 401 and add the part after /wp-json/ to Allowed routes.
Does it work with mobile or headless apps?
Requests that log in with an application password count as logged in. Apps that read without logging in need their routes allowed.