Web Development

How To Bulk Delete Spam Comments On A WordPress Site

mass delete wordpress comments

Just logged into one of the many websites that I manage only to be met with more than 66,000 spam comments that needed to be deleted. Trying to delete them via the Comments section of the WordPress dashboard did not work. Every time that I tried to select “Empty Spam”, I was met with a blank page that did nothing. It seemed that the number of spam comments was greater than wordpress could handle. After a little research online, I found this super quick and easy way to bulk delete unnecessary spam comments from a wordpress website. All it requires is running a line of code in your phpAdmin panel.

DELETE FROM wp_comments WHERE comment_approved = 0

What you want to do is log in to your web hosting account,
navigate over to your MySQL Administration area,
then to your PHPAdmin area.
Select the database for the website that you want to delete the spam from.
Choose to run SQL and type or paste in the above code.
If you have changed the prefix on your WordPress database, change the wp_ to whatever your prefix is.
Run the command and all of the spam will be deleted.

Super easy.

Tags: , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>