Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Removes user endpoints from WordPress REST API
* Remove API Endpoints
* Clobber API routes to remove them from public access.
function remove_wp_json_api_endpoints($endpoints) {
$toRemove = array(
foreach ($toRemove as $item) {
return $endpoints;
add_filter('rest_endpoints', 'remove_wp_json_api_endpoints');

This comment has been minimized.

Copy link
Owner Author

@aubricus aubricus commented Nov 20, 2018

Updated to be slightly more extensible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment