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

---

# File: wp-includes/comment.php

 * hook[pingback_useragent](https://developer.wordpress.org/reference/hooks/pingback_useragent/)
 * Filters the user agent sent when pinging-back a URL.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/pingback_useragent/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/pingback_useragent/#uses)
   | Source: [wp-includes/comment.php:3607](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3607-L3607)
 * function[privacy_ping_filter()](https://developer.wordpress.org/reference/functions/privacy_ping_filter/)
 * Checks whether blog is public before returning sites.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/privacy_ping_filter/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/privacy_ping_filter/#uses)
   | Source: [wp-includes/comment.php:3633](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3633-L3639)
 * function[trackback()](https://developer.wordpress.org/reference/functions/trackback/)
 * Sends a Trackback.
 * Used by [2 functions](https://developer.wordpress.org/reference/functions/trackback/#used-by)
   | Uses [6 functions](https://developer.wordpress.org/reference/functions/trackback/#uses)
   | Source: [wp-includes/comment.php:3656](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3656-L3680)
 * function[weblog_ping()](https://developer.wordpress.org/reference/functions/weblog_ping/)
 * Sends a pingback.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/weblog_ping/#used-by)
   | Uses [5 functions](https://developer.wordpress.org/reference/functions/weblog_ping/#uses)
   | Source: [wp-includes/comment.php:3690](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3690-L3705)
 * function[pingback_ping_source_uri()](https://developer.wordpress.org/reference/functions/pingback_ping_source_uri/)
 * Default filter attached to pingback_ping_source_uri to validate the pingback’s
   Source URI.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/pingback_ping_source_uri/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/pingback_ping_source_uri/#uses)
   | Source: [wp-includes/comment.php:3717](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3717-L3719)
 * function[xmlrpc_pingback_error()](https://developer.wordpress.org/reference/functions/xmlrpc_pingback_error/)
 * Default filter attached to xmlrpc_pingback_error.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/xmlrpc_pingback_error/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/xmlrpc_pingback_error/#uses)
   | Source: [wp-includes/comment.php:3734](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3734-L3739)
 * function[clean_comment_cache()](https://developer.wordpress.org/reference/functions/clean_comment_cache/)
 * Removes a comment from the object cache.
 * Used by [8 functions](https://developer.wordpress.org/reference/functions/clean_comment_cache/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/functions/clean_comment_cache/#uses)
   | Source: [wp-includes/comment.php:3752](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3752-L3767)
 * function[update_comment_cache()](https://developer.wordpress.org/reference/functions/update_comment_cache/)
 * Updates the comment cache of given comments.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/update_comment_cache/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/functions/update_comment_cache/#uses)
   | Source: [wp-includes/comment.php:3782](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3782-L3797)
 * function[_close_comments_for_old_posts()](https://developer.wordpress.org/reference/functions/_close_comments_for_old_posts/)
 * Closes comments on old posts on the fly, without any extra DB queries. Hooked
   to the_posts.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/_close_comments_for_old_posts/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/functions/_close_comments_for_old_posts/#uses)
   | Source: [wp-includes/comment.php:3841](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3841-L3869)
 * hook[close_comments_for_post_types](https://developer.wordpress.org/reference/hooks/close_comments_for_post_types/)
 * Filters the list of post types to automatically close comments for.
 * Used by [2 functions](https://developer.wordpress.org/reference/hooks/close_comments_for_post_types/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/close_comments_for_post_types/#uses)
   | Source: [wp-includes/comment.php:3853](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3853-L3853)
 * function[_close_comments_for_old_post()](https://developer.wordpress.org/reference/functions/_close_comments_for_old_post/)
 * Closes comments on an old post. Hooked to comments_open and pings_open.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/_close_comments_for_old_post/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/functions/_close_comments_for_old_post/#uses)
   | Source: [wp-includes/comment.php:3881](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3881-L3913)
 * hook[preprocess_comment](https://developer.wordpress.org/reference/hooks/preprocess_comment/)
 * Filters a comment’s data before it is sanitized and inserted into the database.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/preprocess_comment/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/preprocess_comment/#uses)
   | Source: [wp-includes/comment.php:2405](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L2405-L2405)
 * hook[comment_post](https://developer.wordpress.org/reference/hooks/comment_post/)
 * Fires immediately after a comment is inserted into the database.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/comment_post/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/comment_post/#uses)
   | Source: [wp-includes/comment.php:2491](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L2491-L2491)
 * function[wp_set_comment_status()](https://developer.wordpress.org/reference/functions/wp_set_comment_status/)
 * Sets the status of a comment.
 * Used by [7 functions](https://developer.wordpress.org/reference/functions/wp_set_comment_status/#used-by)
   | Uses [9 functions](https://developer.wordpress.org/reference/functions/wp_set_comment_status/#uses)
   | Source: [wp-includes/comment.php:2795](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L2795-L2849)
 * function[wp_update_comment()](https://developer.wordpress.org/reference/functions/wp_update_comment/)
 * Updates an existing comment in the database.
 * Used by [3 functions](https://developer.wordpress.org/reference/functions/wp_update_comment/#used-by)
   | Uses [21 functions](https://developer.wordpress.org/reference/functions/wp_update_comment/#uses)
   | Source: [wp-includes/comment.php:2869](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L2869-L3021)
 * hook[comment_save_pre](https://developer.wordpress.org/reference/hooks/comment_save_pre/)
 * Filters the comment content before it is updated in the database.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/comment_save_pre/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/comment_save_pre/#uses)
   | Source: [wp-includes/comment.php:2925](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L2925-L2925)
 * hook[edit_comment](https://developer.wordpress.org/reference/hooks/edit_comment/)
 * Fires immediately after a comment is updated in the database.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/edit_comment/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/edit_comment/#uses)
   | Source: [wp-includes/comment.php:3014](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3014-L3014)
 * function[wp_defer_comment_counting()](https://developer.wordpress.org/reference/functions/wp_defer_comment_counting/)
 * Determines whether to defer comment counting.
 * Used by [3 functions](https://developer.wordpress.org/reference/functions/wp_defer_comment_counting/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/wp_defer_comment_counting/#uses)
   | Source: [wp-includes/comment.php:3036](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3036-L3048)
 * function[wp_update_comment_count()](https://developer.wordpress.org/reference/functions/wp_update_comment_count/)
 * Updates the comment count for post(s).
 * Used by [5 functions](https://developer.wordpress.org/reference/functions/wp_update_comment_count/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/functions/wp_update_comment_count/#uses)
   | Source: [wp-includes/comment.php:3071](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3071-L3094)
 * function[wp_update_comment_count_now()](https://developer.wordpress.org/reference/functions/wp_update_comment_count_now/)
 * Updates the comment count for the post.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/wp_update_comment_count_now/#used-by)
   | Uses [8 functions](https://developer.wordpress.org/reference/functions/wp_update_comment_count_now/#uses)
   | Source: [wp-includes/comment.php:3106](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3106-L3165)
 * hook[wp_update_comment_count](https://developer.wordpress.org/reference/hooks/wp_update_comment_count/)
 * Fires immediately after a post’s comment count is updated in the database.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/wp_update_comment_count/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/wp_update_comment_count/#uses)
   | Source: [wp-includes/comment.php:3156](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3156-L3156)
 * function[discover_pingback_server_uri()](https://developer.wordpress.org/reference/functions/discover_pingback_server_uri/)
 * Finds a pingback server URI based on the given URL.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/discover_pingback_server_uri/#used-by)
   | Uses [7 functions](https://developer.wordpress.org/reference/functions/discover_pingback_server_uri/#uses)
   | Source: [wp-includes/comment.php:3184](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3184-L3260)
 * function[do_all_pings()](https://developer.wordpress.org/reference/functions/do_all_pings/)
 * Performs all pingbacks, enclosures, trackbacks, and sends to pingback services.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/do_all_pings/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/do_all_pings/#uses)
   | Source: [wp-includes/comment.php:3268](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3268-L3275)
 * function[do_trackbacks()](https://developer.wordpress.org/reference/functions/do_trackbacks/)
 * Performs trackbacks.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/do_trackbacks/#used-by)
   | Uses [9 functions](https://developer.wordpress.org/reference/functions/do_trackbacks/#uses)
   | Source: [wp-includes/comment.php:3354](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3354-L3401)
 * hook[pre_comment_user_ip](https://developer.wordpress.org/reference/hooks/pre_comment_user_ip/)
 * Filters the comment author’s IP address before it is set.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/pre_comment_user_ip/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/pre_comment_user_ip/#uses)
   | Source: [wp-includes/comment.php:2294](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L2294-L2294)
 * function[generic_ping()](https://developer.wordpress.org/reference/functions/generic_ping/)
 * Sends pings to all of the ping site services.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/generic_ping/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/functions/generic_ping/#uses)
   | Source: [wp-includes/comment.php:3411](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3411-L3423)
 * function[wp_throttle_comment_flood()](https://developer.wordpress.org/reference/functions/wp_throttle_comment_flood/)
 * Determines whether a comment should be blocked because of comment flood.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/wp_throttle_comment_flood/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/functions/wp_throttle_comment_flood/#uses)
   | Source: [wp-includes/comment.php:2315](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L2315-L2323)
 * function[pingback()](https://developer.wordpress.org/reference/functions/pingback/)
 * Pings back the links found in a post.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/pingback/#used-by)
   | Uses [12 functions](https://developer.wordpress.org/reference/functions/pingback/#uses)
   | Source: [wp-includes/comment.php:3514](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3514-L3623)
 * function[wp_new_comment()](https://developer.wordpress.org/reference/functions/wp_new_comment/)
 * Adds a new comment to the database.
 * Used by [4 functions](https://developer.wordpress.org/reference/functions/wp_new_comment/#used-by)
   | Uses [11 functions](https://developer.wordpress.org/reference/functions/wp_new_comment/#uses)
   | Source: [wp-includes/comment.php:2372](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L2372-L2494)
 * hook[pre_ping](https://developer.wordpress.org/reference/hooks/pre_ping/)
 * Fires just before pinging back links found in a post.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/pre_ping/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/pre_ping/#uses)
   | Source: [wp-includes/comment.php:3578](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L3578-L3578)

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

[1](https://developer.wordpress.org/reference/files/wp-includes/comment.php/?output_format=md)
[2](https://developer.wordpress.org/reference/files/wp-includes/comment.php/page/2/?output_format=md)
3 [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/4/?output_format=md)