WordPress Delete All Spam Comments

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"

One Response to WordPress Delete All Spam Comments

  1. allyw1212@bellsouth.net April 17, 2013 at 10:05 am #

    Thanks Todd!

Leave a Reply

15,861 Spam Comments Blocked so far by Spam Free Wordpress

HTML tags are not allowed.