Title: comment_excerpt_length
Published: December 9, 2015
Last modified: April 28, 2025

---

# apply_filters( ‘comment_excerpt_length’, int $comment_excerpt_length )

## In this article

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

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

Filters the maximum number of words used in the comment excerpt.

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

 `$comment_excerpt_length`int

The amount of words you want to display in the comment excerpt.

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

    ```php
    $comment_excerpt_length = apply_filters( 'comment_excerpt_length', $comment_excerpt_length );
    ```

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

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

| Used by | Description | 
| [get_comment_excerpt()](https://developer.wordpress.org/reference/functions/get_comment_excerpt/)`wp-includes/comment-template.php` |

Retrieves the excerpt of the given comment.

  |

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

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

## User Contributed Notes

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