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
- How to use WP-REST API to login user and get user data for Android app?
- How do I cache (core) API requests?
- WP REST API returns blank response if post is too long
- How to feed a HTML5’s EventSource with a REST API custom endpoint?
- Retrieve CSS and JS From the REST API
- How to Authenticate WP REST API with JWT Authentication using Fetch API
- WordPress 4.7 REST API endpoints
- WP REST API V2 – Modifying responses
- Can’t send emails through REST API
- How to login to WordPress site using basic authentication HTTP headers?
- Unable to get the info of the user which doesn’t have created any post via REST API
- WP Rest API convert permalink to post ID for fetch
- Can’t GET draft posts via REST API from headless frontend
- How to update custom meta fields with rest api?
- Formating content rendered from wordpress REST API as JSON and not HTML
- WordPress API returns empty page when page is less than X-WP-TotalPages
- Rest API and Custom Fields
- How can I return an image from a custom REST API endpoint?
- WordPress REST API, Expired Nonce from Cache results in 403 forbidden
- WP Rest API: Get User by Email
- Check Password Strength using WordPress API
- Get all tags not just first 10 with wp api 2.0
- Send request to WordPress REST API
- Request to REST endpoint works fine in browser and curl, but fails from WP_REST_Request
- WP REST api.wordpress.org discovery
- Rest API in integration tests – filtering by slug not working?
- WP REST API V2 – Add user data to response
- How do you format the set_body option for WP_Rest_Request?
- How to add / embed an author into REST data from a custom post type?
- featured image not found in json from wp rest api
- How to enable the view of revisions of post in WordPress Api for custom post type?
- Problem on creating custom endpoints for REST
- WordPress API for search
- rendering view in backbone
- Manipulating/view postmeta remotely
- Check authentication credentials using WP REST API
- WordPress REST API V2: how to get list of all posts?
- Getting 401 from ajax using an application password
- How to connect android app with WordPress website?
- How to create WordPress custom end point with multiple parameters?
- WordPress REST API calls that depend on the WordPress User
- How to get data from /wp-json/wp/v2/users/me
- WordPress REST API parameters are not affecting a response
- Update meta_value in wp_postmeta using API
- Cant create or update meta fields using WordPress REST API
- Flatten Responses returned via WP REST API via WP_Error for obfuscation
- WordPress plugin with CORS
- User following system via REST API
- “Error: cURL error 60: SSL certificate problem: certificate has expired” when create product in WooCommerce via REST API
- How to use WordPress REST api to login a user?
- Can I overwrite default WordPress Json API For no more pages text
- Secure WordPress API, how?
- Wrong encoding of dynamic block properties problem when loggen in as editor
- Media gallery images url instead of ID on WP API
- What’s the right way to validate JSON data coming from an AJAX POST request?
- How to add a post’s view count into the WordPress API response
- Need wp rest api for featured video post
- WordPress Update Role using API Cross site
- Rest API. Post content
- REST api header link href
- WordPress & React Native
- Is it possible to combine two rest endpoints in the url?
- Consume legacy rest api dependent upon WP API plugin
- update meta data (like view counter) by rest-api
- Rest API hook ‘rest_insert_post’ not returning request object
- How Can I keep password protected posts in the json requests but not on frontend queries?
- Retrieve posts by page in wp rest api
- How can I set the default ‘orderby’ and ‘order’ parameters for a REST API call?
- External api call using wordpress
- What filtering is available for backbone.js?
- How to limit what fields are returned through the WP API Backbone JS client