The following SQL code will recalculate comment counts for all nodes on your site.
update node_comment_statistics ncs set comment_count = (select count(*) from comment c where c.nid = ncs.nid) where 1=1
As with all these things, you should take a backup before running the script and run at your own risk. That said, it's basically safe to run and re-run this script whenever you like.
Add new comment