Reputation: 99
When I was cleaning my website from spams, I noticed a high number of comments (600+) in admin dashboard. Instead of going through one by one and deleting them, I decided to nuke all unapproved comments with this sql query:
delete from wp_comments where comment_approved = 0
Now my admin dashboard is STILL showing the same number of comments but all the actual comments are gone. How do I reset this counter back to zero.
Upvotes: 0
Views: 1053
Reputation: 99
In my case, as soon as new comments came in, the old counter disappear. The comment counter will just revert back to normal.
Upvotes: 0
Reputation: 2016
For that pending comments you have to approve or reject to remove counter..! you can use Bulk Actions for Approve at once ..!
Upvotes: 0
Reputation: 1856
If you prefer the SQL way, you can do:
UPDATE wp_posts SET comment_count = 0 WHERE id = id
Or you have a wordpress function: wp_update_comment_count( $post_id, $do_deferred )
Upvotes: 2