Title: rest_queried_resource_route
Published: August 11, 2020
Last modified: August 20, 2026

---

# apply_filters( ‘rest_queried_resource_route’, string $link )

## In this article

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

Filters the REST route for the currently queried object.

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

 `$link`string

The route with a leading slash, or an empty string.

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

    ```php
    return apply_filters( 'rest_queried_resource_route', $route );
    ```

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

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

| Used by | Description | 
| [rest_get_queried_resource_route()](https://developer.wordpress.org/reference/functions/rest_get_queried_resource_route/)`wp-includes/rest-api.php` |

Gets the REST route for the currently queried object.

  |

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

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

## User Contributed Notes

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