Sparrow Plugins

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

Pro

The free version is complete on its own. Pro adds:

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.