Title: comment_id_fields
Published: April 25, 2014
Last modified: February 24, 2026

---

# apply_filters( ‘comment_id_fields’, string $comment_id_fields, int $post_id, int $reply_to_id )

## In this article

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

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

Filters the returned comment ID fields.

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

 `$comment_id_fields`string

The HTML-formatted hidden ID field comment elements.

`$post_id`int

The post ID.

`$reply_to_id`int

The ID of the comment being replied to.

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

    ```php
    return apply_filters( 'comment_id_fields', $comment_id_fields, $post_id, $reply_to_id );
    ```

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

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

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

Retrieves hidden input HTML for replying to comments.

  |

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

| Version | Description | 
| [3.0.0](https://developer.wordpress.org/reference/since/3.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_id_fields%2F)
before being able to contribute a note or feedback.