Title: wp-includes/comment.php | Page 2 of 5 | Developer.WordPress.org

---

# File: wp-includes/comment.php

 * function[wp_register_comment_personal_data_exporter()](https://developer.wordpress.org/reference/functions/wp_register_comment_personal_data_exporter/)
 * Registers the personal data exporter for comments.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/wp_register_comment_personal_data_exporter/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/wp_register_comment_personal_data_exporter/#uses)
   | Source: [wp-includes/comment.php:4167](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L4167-L4174)
 * function[wp_comments_personal_data_exporter()](https://developer.wordpress.org/reference/functions/wp_comments_personal_data_exporter/)
 * Finds and exports personal data associated with an email address from the comments
   table.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/wp_comments_personal_data_exporter/#used-by)
   | Uses [6 functions](https://developer.wordpress.org/reference/functions/wp_comments_personal_data_exporter/#uses)
   | Source: [wp-includes/comment.php:4190](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L4190-L4272)
 * function[wp_register_comment_personal_data_eraser()](https://developer.wordpress.org/reference/functions/wp_register_comment_personal_data_eraser/)
 * Registers the personal data eraser for comments.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/wp_register_comment_personal_data_eraser/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/wp_register_comment_personal_data_eraser/#uses)
   | Source: [wp-includes/comment.php:4282](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L4282-L4289)
 * function[wp_comments_personal_data_eraser()](https://developer.wordpress.org/reference/functions/wp_comments_personal_data_eraser/)
 * Erases personal data associated with an email address from the comments table.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/wp_comments_personal_data_eraser/#used-by)
   | Uses [7 functions](https://developer.wordpress.org/reference/functions/wp_comments_personal_data_eraser/#uses)
   | Source: [wp-includes/comment.php:4309](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L4309-L4400)
 * hook[wp_anonymize_comment](https://developer.wordpress.org/reference/hooks/wp_anonymize_comment/)
 * Filters whether to anonymize the comment.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/wp_anonymize_comment/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/wp_anonymize_comment/#uses)
   | Source: [wp-includes/comment.php:4363](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L4363-L4363)
 * hook[wp_update_comment_data](https://developer.wordpress.org/reference/hooks/wp_update_comment_data/)
 * Filters the comment data immediately before it is updated in the database.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/wp_update_comment_data/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/wp_update_comment_data/#uses)
   | Source: [wp-includes/comment.php:2953](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L2953-L2953)
 * function[_clear_modified_cache_on_transition_comment_status()](https://developer.wordpress.org/reference/functions/_clear_modified_cache_on_transition_comment_status/)
 * Clears the lastcommentmodified cached value when a comment status is changed.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/_clear_modified_cache_on_transition_comment_status/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/_clear_modified_cache_on_transition_comment_status/#uses)
   | Source: [wp-includes/comment.php:2022](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L2022-L2030)
 * function[wp_check_comment_data_max_lengths()](https://developer.wordpress.org/reference/functions/wp_check_comment_data_max_lengths/)
 * Compares the lengths of comment data against the maximum character limits.
 * Used by [3 functions](https://developer.wordpress.org/reference/functions/wp_check_comment_data_max_lengths/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/functions/wp_check_comment_data_max_lengths/#uses)
   | Source: [wp-includes/comment.php:1319](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L1319-L1339)
 * hook[wp_is_comment_flood](https://developer.wordpress.org/reference/hooks/wp_is_comment_flood/)
 * Filters whether a comment is part of a comment flood.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/wp_is_comment_flood/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/wp_is_comment_flood/#uses)
   | Source: [wp-includes/comment.php:858](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L858-L865)
 * function[wp_check_comment_flood()](https://developer.wordpress.org/reference/functions/wp_check_comment_flood/)
 * Checks whether comment flooding is occurring.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/wp_check_comment_flood/#used-by)
   | Uses [11 functions](https://developer.wordpress.org/reference/functions/wp_check_comment_flood/#uses)
   | Source: [wp-includes/comment.php:909](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L909-L989)
 * hook[clean_comment_cache](https://developer.wordpress.org/reference/hooks/clean_comment_cache/)
 * Fires immediately after a comment has been removed from the object cache.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/clean_comment_cache/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/clean_comment_cache/#uses)
   | Source: [wp-includes/comment.php:3763](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3763-L3763)
 * hook[pre_wp_update_comment_count_now](https://developer.wordpress.org/reference/hooks/pre_wp_update_comment_count_now/)
 * Filters a post’s comment count before it is updated in the database.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/pre_wp_update_comment_count_now/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/pre_wp_update_comment_count_now/#uses)
   | Source: [wp-includes/comment.php:3135](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3135-L3135)
 * function[wp_get_comment_fields_max_lengths()](https://developer.wordpress.org/reference/functions/wp_get_comment_fields_max_lengths/)
 * Retrieves the maximum character lengths for the comment form fields.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/wp_get_comment_fields_max_lengths/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/functions/wp_get_comment_fields_max_lengths/#uses)
   | Source: [wp-includes/comment.php:1264](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L1264-L1308)
 * hook[wp_get_comment_fields_max_lengths](https://developer.wordpress.org/reference/hooks/wp_get_comment_fields_max_lengths/)
 * Filters the lengths for the comment form fields.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/wp_get_comment_fields_max_lengths/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/wp_get_comment_fields_max_lengths/#uses)
   | Source: [wp-includes/comment.php:1307](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L1307-L1307)
 * function[_prime_comment_caches()](https://developer.wordpress.org/reference/functions/_prime_comment_caches/)
 * Adds any comments from the given IDs to the cache that do not already exist in
   cache.
 * Used by [3 functions](https://developer.wordpress.org/reference/functions/_prime_comment_caches/#used-by)
   | Uses [4 functions](https://developer.wordpress.org/reference/functions/_prime_comment_caches/#uses)
   | Source: [wp-includes/comment.php:3812](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3812-L3825)
 * function[wp_handle_comment_submission()](https://developer.wordpress.org/reference/functions/wp_handle_comment_submission/)
 * Handles the submission of a comment, usually posted to wp-comments-post.php via
   a comment form.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/wp_handle_comment_submission/#used-by)
   | Uses [24 functions](https://developer.wordpress.org/reference/functions/wp_handle_comment_submission/#uses)
   | Source: [wp-includes/comment.php:3936](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3936-L4157)
 * function[wp_new_comment_notify_moderator()](https://developer.wordpress.org/reference/functions/wp_new_comment_notify_moderator/)
 * Sends a comment moderation notification to the comment moderator.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/wp_new_comment_notify_moderator/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/functions/wp_new_comment_notify_moderator/#uses)
   | Source: [wp-includes/comment.php:2504](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L2504-L2518)
 * function[wp_new_comment_notify_postauthor()](https://developer.wordpress.org/reference/functions/wp_new_comment_notify_postauthor/)
 * Sends a notification of a new comment to the post author.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/wp_new_comment_notify_postauthor/#used-by)
   | Uses [4 functions](https://developer.wordpress.org/reference/functions/wp_new_comment_notify_postauthor/#uses)
   | Source: [wp-includes/comment.php:2534](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L2534-L2578)
 * hook[notify_post_author](https://developer.wordpress.org/reference/hooks/notify_post_author/)
 * Filters whether to send the post author new comment and note notification emails,
   overriding the site settings and defaults. By default, notifications are sent
   for all notes and for approved comments.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/notify_post_author/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/notify_post_author/#uses)
   | Source: [wp-includes/comment.php:2567](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L2567-L2567)
 * hook[get_page_of_comment](https://developer.wordpress.org/reference/hooks/get_page_of_comment/)
 * Filters the calculated page on which a comment appears.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/get_page_of_comment/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/get_page_of_comment/#uses)
   | Source: [wp-includes/comment.php:1252](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L1252-L1252)
 * hook[duplicate_comment_id](https://developer.wordpress.org/reference/hooks/duplicate_comment_id/)
 * Filters the ID, if any, of the duplicate comment found when creating a new comment.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/duplicate_comment_id/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/duplicate_comment_id/#uses)
   | Source: [wp-includes/comment.php:788](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L788-L788)
 * function[get_default_comment_status()](https://developer.wordpress.org/reference/functions/get_default_comment_status/)
 * Gets the default comment status for a post type.
 * Used by [4 functions](https://developer.wordpress.org/reference/functions/get_default_comment_status/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/functions/get_default_comment_status/#uses)
   | Source: [wp-includes/comment.php:363](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L363-L396)
 * hook[get_default_comment_status](https://developer.wordpress.org/reference/hooks/get_default_comment_status/)
 * Filters the default comment status for the given post type.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/get_default_comment_status/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/get_default_comment_status/#uses)
   | Source: [wp-includes/comment.php:395](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L395-L395)
 * hook[wp_set_comment_status](https://developer.wordpress.org/reference/hooks/wp_set_comment_status/)
 * Fires immediately after transitioning a comment’s status from one to another 
   in the database and removing the comment from the object cache, but prior to 
   all status transition hooks.
 * Used by [2 functions](https://developer.wordpress.org/reference/hooks/wp_set_comment_status/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/wp_set_comment_status/#uses)
   | Source: [wp-includes/comment.php:2842](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L2842-L2842)
 * hook[comment_id_not_found](https://developer.wordpress.org/reference/hooks/comment_id_not_found/)
 * Fires when a comment is attempted on a post that does not exist.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/comment_id_not_found/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/comment_id_not_found/#uses)
   | Source: [wp-includes/comment.php:3996](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3996-L3996)
 * hook[comment_closed](https://developer.wordpress.org/reference/hooks/comment_closed/)
 * Fires when a comment is attempted on a post that has comments closed.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/comment_closed/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/comment_closed/#uses)
   | Source: [wp-includes/comment.php:4020](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L4020-L4020)
 * hook[comment_on_trash](https://developer.wordpress.org/reference/hooks/comment_on_trash/)
 * Fires when a comment is attempted on a trashed post.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/comment_on_trash/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/comment_on_trash/#uses)
   | Source: [wp-includes/comment.php:4033](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L4033-L4033)
 * hook[comment_on_draft](https://developer.wordpress.org/reference/hooks/comment_on_draft/)
 * Fires when a comment is attempted on a post in draft mode.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/comment_on_draft/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/comment_on_draft/#uses)
   | Source: [wp-includes/comment.php:4046](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L4046-L4046)
 * hook[comment_on_password_protected](https://developer.wordpress.org/reference/hooks/comment_on_password_protected/)
 * Fires when a comment is attempted on a password-protected post.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/comment_on_password_protected/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/comment_on_password_protected/#uses)
   | Source: [wp-includes/comment.php:4062](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L4062-L4062)
 * hook[pre_comment_on_post](https://developer.wordpress.org/reference/hooks/pre_comment_on_post/)
 * Fires before a comment is posted.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/pre_comment_on_post/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/pre_comment_on_post/#uses)
   | Source: [wp-includes/comment.php:4074](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L4074-L4074)

 [Previous Page](https://developer.wordpress.org/reference/files/wp-includes/comment.php/?output_format=md)

[1](https://developer.wordpress.org/reference/files/wp-includes/comment.php/?output_format=md)
2 [3](https://developer.wordpress.org/reference/files/wp-includes/comment.php/page/3/?output_format=md)
[4](https://developer.wordpress.org/reference/files/wp-includes/comment.php/page/4/?output_format=md)
[5](https://developer.wordpress.org/reference/files/wp-includes/comment.php/page/5/?output_format=md)

 [Next Page](https://developer.wordpress.org/reference/files/wp-includes/comment.php/page/3/?output_format=md)