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

---

# apply_filters( ‘rest_comment_trashable’, bool $supports_trash, WP_Comment $comment )

## In this article

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

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

Filters whether a comment can be trashed via the REST API.

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

Return false to disable trash support for the comment.

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

 `$supports_trash`bool

Whether the comment supports trashing.

`$comment`[WP_Comment](https://developer.wordpress.org/reference/classes/wp_comment/)

The comment object being considered for trashing support.

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

    ```php
    $supports_trash = apply_filters( 'rest_comment_trashable', ( EMPTY_TRASH_DAYS > 0 ), $comment );
    ```

[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#L1060)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php#L1060-L1060)

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

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

Deletes a comment.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/rest_comment_trashable/?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_trashable%2F)
before being able to contribute a note or feedback.