简体   繁体   中英

Remove wordpress comments counter in Admin dashboard

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. 评论计数器仍未重置

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 )

WP Codex

For that pending comments you have to approve or reject to remove counter..! you can use Bulk Actions for Approve at once ..!

在此处输入图片说明

In my case, as soon as new comments came in, the old counter disappear. The comment counter will just revert back to normal.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM