Title: duplicate_comment_id
Published: December 9, 2015
Last modified: February 24, 2026

---

# apply_filters( ‘duplicate_comment_id’, int $dupe_id, array $commentdata )

## In this article

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

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

Filters the ID, if any, of the duplicate comment found when creating a new comment.

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

Return an empty value from this filter to allow what WP considers a duplicate comment.

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

 `$dupe_id`int

ID of the comment identified as a duplicate.

`$commentdata`array

Data for the comment being created.

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

    ```php
    $dupe_id = apply_filters( 'duplicate_comment_id', $dupe_id, $commentdata );
    ```

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

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

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

Validates whether this comment is allowed to be made.

  |

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