You can use the filter hook ‘rest_index’ :
add_filter('rest_index', function ($response) {
$data = $response->get_data();
$data['namespaces'] = [];
$data['routes'] = [];
return $data;
}, 9999, 1);
It is possible to remove your route from $data[‘namespaces’] and $data[‘routes’]
Related Posts:
- Get post count in wp rest API v2 and get all categories
- Are there server performance benefits to fetching only specific fields when querying the REST API?
- WordPress Rest API: How do we validate with our custom API key?
- Can we access the REST request parameters from within the permission_callback to enforce a 401 by returning false?
- WordPress REST API “rest_authentication_errors” doesn’t work external queries?
- How to filter users on custom meta fields in WP JSON v2?
- Gutenberg Custom Block Getting All Posts
- Display post title from WordPress excluding a string via API
- WP_REMOTE_POST Requests are being blocked by API provider [closed]
- is it possible to filter a rest api endpoint by using a registered rest field?
- Use the backbone.js client to save custom post type meta
- No ‘Access-Control-Allow-Origin’ when call rest API
- Update a post based on results from GET request to another server
- WP API post__not_in is not working
- Get a remote post ID via API given URL
- Core function to check if a rest namespace exists
- How to change the date and time in REST API for comments?
- Is there a way to download only the Rest API part of WordPress?
- WordPress REST Api get posts by ID
- How to use Python to create a Post in WordPress?
- Cannot use WordPress Application Passwords: “code”: “rest_no_route” “status”:404 for /wp-json/wp/v2/users/me/application-passwords
- How to display relations via wordpress Rest API
- register/login api
- WordPress REST API in Integromat: How to overcome “Sorry, you are not allowed to list users / edit this…”
- Remove unwanted fields from WP API response
- WordPress API “code”:”rest_no_route” with Custom Route
- API request forbidden when requesting from same domain
- Woocommerce API for calling products by Category ID
- wordpress rest api authentication failed
- Transmit headers and footers via API from one site to another
- Is the WordPress REST API installed and enabled in a vanilla WordPress 4.7 installation?
- Does something like is_rest() exist
- Hiding WordPress REST API v2 endpoints from public viewing
- How to: Make JWT-authenticated requests to the WordPress API
- REST API purpose?
- WP REST API — How to change HTTP Response status code?
- wp_get_current_user() function not working in Rest API callback function
- How to use WP-REST API to login user and get user data for Android app?
- WP REST API Is it rather easy to rename the default wp-json uri part?
- Query WP REST API v2 by multiple meta keys
- Search WP API using the post title
- check the requesting url
- How would I add custom tables/endpoints to the WP REST API?
- WP REST API Require Password for GET Endpoint
- Displaying a page built with Elementor using the REST API [closed]
- Getting user meta data from WP REST API
- How do I cache (core) API requests?
- WP REST API only returning partial list of users
- Understanding SHORTINIT with WordPress 5
- Is there a way to get protected meta fields through any of the available built-in WordPress APIs? (xmlrpc, wp-json)
- How to use _embed when using _fields?
- WP REST API V2 – Retrieve sub page by full slug (URL/Path)
- WP REST API create post authentication issue
- Why is my custom API endpoint not working?
- WordPress REST API validation
- wp rest api v2 return json_no_route
- Retrieving pages with multiple tags using REST API
- How to define a query parameter with REST API?
- Filter posts by multiple custom taxonomy terms using AND operator in REST API v2 (WordPress)
- WP REST API returns blank response if post is too long
- WP-REST API not returning all its endpoints, 404 on documented endpoints
- How do I correctly setup an AJAX nonce for WordPress REST API?
- WP Rest API v2 filter and display latest post with specific tag
- Increase per_page limit in REST API
- Does pre_get_posts affect REST API responses?
- How to feed a HTML5’s EventSource with a REST API custom endpoint?
- How do I use the WP REST API plugin and the OAuth Server plugin to allow for registration and login?
- Adding WordPress API Endpoint With Multiple Parameters
- How to loop through JSON data in wordpress WP REST API
- Retrieve CSS and JS From the REST API
- Using the REST API (v2) javascript client on a private namespaced route
- How to Authenticate WP REST API with JWT Authentication using Fetch API
- authentication issue with rest api – rest_cannot_create
- WP REST API core major changes
- WordPress 4.7 REST API endpoints
- How to get all posts from parent and children categories?
- wordpress wp-json prefix issue
- WP API : date_query parameter
- How to filter or search the posts using postmeta tables custom meta fields with wordpress REST API
- Get blog title with REST v2
- Is it possible to nest the JSON result of WordPress REST API?
- WP REST API V2 – Modifying responses
- Match REST API post output from custom endpoint
- How to use the WP REST API for new user registration (sign up form)?
- Can I authenticate with both WooCommerce consumer key and JWT?
- Get the Category Name instead of ID from WP-API
- Get more than 10 posts in a specific category with the wordpress api
- REST API multiple media upload
- Filter post_content before loading in Gutenberg editor
- Attach featured image to custom endpoints
- WP REST API – Retrieve content from page
- Can’t send emails through REST API
- 401 Error when trying to make a REST API call to site
- WordPress: How to create custom REST API route?
- Create post using rest api with html content
- Does jQuery/Ajax send cookies when using the rest API or do I need to somehow add them?
- WP REST API: check if user is logged in
- How to change user avatar using REST API?
- How to login to WordPress site using basic authentication HTTP headers?
- wordpress custom endpoint multiple params