Title: rest_route_data
Published: December 9, 2015
Last modified: August 20, 2026

---

# apply_filters( ‘rest_route_data’, array[] $available, array $routes )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/rest_route_data/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/rest_route_data/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/rest_route_data/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/rest_route_data/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/rest_route_data/?output_format=md#changelog)

Filters the publicly-visible data for REST API routes.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/rest_route_data/?output_format=md#description)󠁿

This data is exposed on indexes and can be used by clients or developers to investigate
the site and find out how to use it. It acts as a form of self-documentation.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/rest_route_data/?output_format=md#parameters)󠁿

 `$available`array[]

Route data to expose in indexes, keyed by route.

`$routes`array

Internal route data as an associative array.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/rest_route_data/?output_format=md#source)󠁿

    ```php
    return apply_filters( 'rest_route_data', $available, $routes );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/class-wp-rest-server.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1620)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1620-L1620)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/rest_route_data/?output_format=md#related)󠁿

| Used by | Description | 
| [WP_REST_Server::get_data_for_routes()](https://developer.wordpress.org/reference/classes/wp_rest_server/get_data_for_routes/)`wp-includes/rest-api/class-wp-rest-server.php` |

Retrieves the publicly-visible data for routes.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/rest_route_data/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Frest_route_data%2F)
before being able to contribute a note or feedback.