Mass Delete WordPress Comments

Every once in awhile you may find yourself needing to mass delete WordPress comments in bulk for either SPAM comments, pending comments, approved comments or already trashed comments.

With access to your database and the ability to run a SQL command you can do any of the above with the proper line of SQL. I keep the below in a quick reference sheet but figure that other’s may find these useful, please use as needed but with caution. The below will remove comments from the default database prefix wp_.

*Always have a backup of your database before making large edits.

Mass Delete WordPress SPAM Comments

DELETE FROM wp_comments WHERE comment_approved = 'spam'

Mass Delete WordPress Pending Comments

DELETE FROM wp_comments WHERE comment_approved = '0'

Mass Delete WordPress Approved Comments

DELETE FROM wp_comments WHERE comment_approved = '1'

Mass Delete WordPress Trashed Comments

DELETE FROM wp_comments WHERE comment_approved = 'trash'

25. March 2014 by Gabe Diaz
Categories: Blog | Leave a comment