Title: get_comment_author
Published: April 25, 2014
Last modified: April 28, 2025

---

# apply_filters( ‘get_comment_author’, string $comment_author, string $comment_id, WP_Comment $comment )

## In this article

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

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

Filters the returned comment author name.

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

 `$comment_author`string

The comment author’s username.

`$comment_id`string

The comment ID as a numeric string.

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

The comment object.

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

    ```php
    return apply_filters( 'get_comment_author', $comment_author, $comment_id, $comment );
    ```

[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#L56)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/comment-template.php#L56-L56)

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

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

Retrieves the author of the current comment.

  |

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

| Version | Description | 
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | The `$comment_id` and `$comment` parameters were added. | 
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |

## User Contributed Notes

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