Title: rest_request_from_url
Published: April 12, 2016
Last modified: May 20, 2026

---

# apply_filters( ‘rest_request_from_url’, WP_REST_Request|false $request, string $url )

## In this article

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

[ Back to top](https://developer.wordpress.org/reference/hooks/rest_request_from_url/?output_format=md#wp--skip-link--target)

Filters the REST API request generated from a URL.

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

 `$request`[WP_REST_Request](https://developer.wordpress.org/reference/classes/wp_rest_request/)
|false

Generated request object, or false if URL could not be parsed.

`$url`string

URL the request was generated from.

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

    ```php
    return apply_filters( 'rest_request_from_url', $request, $url );
    ```

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

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

| Used by | Description | 
| [WP_REST_Request::from_url()](https://developer.wordpress.org/reference/classes/wp_rest_request/from_url/)`wp-includes/rest-api/class-wp-rest-request.php` |

Retrieves a [WP_REST_Request](https://developer.wordpress.org/reference/classes/wp_rest_request/) object from a full URL.

  |

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

| Version | Description | 
| [4.5.0](https://developer.wordpress.org/reference/since/4.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_request_from_url%2F)
before being able to contribute a note or feedback.