WireCore REST Control restricts access to the WordPress REST API without breaking the block editor or the plugins your visitors rely on. Instead of an all-or-nothing switch, you decide per namespace and per route who may read and who may write.
The route list shows every registered route – WordPress core, themes and all other plugins – and tells you which plugin or theme registered it.
/wp/v2/users) to admins, reset custom rules.Some plugins need the REST API for visitors on the front end. Their namespaces are public as long as you do not set a custom rule. Each of them can be switched off in the settings:
/wp-json/).wp wirecore-rest status|routes|set|default|export|import|log.Rules apply to every real REST request, including embedded responses (_embed) and sub-requests of the batch endpoint (/batch/v1). Internal rest_do_request() calls made by PHP – for example when the block editor preloads data – are not affected.
Settings are stored per site, because every site has its own routes and plugins. The plugin can be network-activated; uninstalling removes the settings of all sites.
wirecore_rc_error – filters the WP_Error of a blocked request (parameters: error, route pattern, method). Returning true allows the request after all.wirecore_rc_client_ip – filters the client IP, e.g. behind a reverse proxy.wirecore_rc_known_namespaces – filters the plugins offered under “Automatic allowances” (array key => [namespaces]).The plugin does not send any data to external services and does not set cookies. If you enable the log, it stores the method, route, IP address (in full, shortened or not at all – configurable), user ID and the reason of blocked requests in the database of your site. The self-test sends requests from your server to its own REST API.
The settings page uses the WireLayer component library (MIT). assets/wirelayer/wirelayer.css is generated from the npm package @wirecore/wirelayer-css with npm run build:css; the source code of the plugin, including package.json, is available at github.com/WireCore/WP-Rest-Control. Bundled with it:
wirelayer.cssassets/wirelayer/fonts/OFL.txt), served from the plugin – no external font service