Title: comment_edit_pre
Published: April 25, 2014
Last modified: August 20, 2026

---

# apply_filters( ‘comment_edit_pre’, string $comment_content )

## In this article

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

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

Filters the comment content before editing.

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

 `$comment_content`string

Comment content.

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

    ```php
    $comment->comment_content = apply_filters( 'comment_edit_pre', $comment->comment_content );
    ```

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

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

| Used by | Description | 
| [WP_Comments_List_Table::column_comment()](https://developer.wordpress.org/reference/classes/wp_comments_list_table/column_comment/)`wp-admin/includes/class-wp-comments-list-table.php` |

Outputs the comment column.

  | 
| [get_comment_to_edit()](https://developer.wordpress.org/reference/functions/get_comment_to_edit/)`wp-admin/includes/comment.php` |

Returns a [WP_Comment](https://developer.wordpress.org/reference/classes/wp_comment/) object based on comment ID.

  |

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

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

## User Contributed Notes

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