Title: rest_comment_collection_params
Published: December 6, 2016
Last modified: May 20, 2026

---

# apply_filters( ‘rest_comment_collection_params’, array $query_params )

## In this article

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

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

Filters REST API collection parameters for the comments controller.

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

This filter registers the collection parameter, but does not map the collection 
parameter to an internal [WP_Comment_Query](https://developer.wordpress.org/reference/classes/wp_comment_query/)
parameter. Use the `rest_comment_query` filter to set [WP_Comment_Query](https://developer.wordpress.org/reference/classes/wp_comment_query/)
parameters.

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

 `$query_params`array

JSON Schema-formatted collection parameters.

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

    ```php
    return apply_filters( 'rest_comment_collection_params', $query_params );
    ```

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

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

| Used by | Description | 
| [WP_REST_Comments_Controller::get_collection_params()](https://developer.wordpress.org/reference/classes/wp_rest_comments_controller/get_collection_params/)`wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php` |

Retrieves the query params for collections.

  |

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

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

## User Contributed Notes

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