WordPress comes with the ability to delete all spam comments, but not all the comment types you may want to delete all at once as a batch. This process can be simplified by using phpMyAdmin to execute SQL queries that complete the job quickly, and without the memory overhead WordPress can create when it attempts to process a large number of comments.
This SQL statement will remove all the unapproved comments at once:
DELETE FROM wp_comments WHERE comment_approved = '0'; |
This SQL statement will remove all the spam comments at once:
DELETE FROM wp_comments WHERE comment_approved = 'spam'; |
This SQL statement will remove all pingbacks and trackbacks:
DELETE FROM wp_comments WHERE comment_type="trackback" |
Thanks Todd!