Categories: Blog

Tutorial: How to Mass Delete Comments in WordPress

Did you logged into your WP Dashboard only to find out several hundreds if not thousands of spam comments waiting to be deleted?

If so you can apply a mass delete and save your time and clicks from deleting them one by one using the following 2 guides.

Mass Delete comments using phpMyAdmin

    1. Open your hosting cpanel, then scroll down to Database Tools and select phpMyAdmin
    2. In the new page that opens select your database
    3. Scroll down the page and select table wp_comments
    4. If you want to delete all comments then just right click on wp_comments table and select empty, confirm and you're done.
      If you want to remove NON APPROVED COMMENTS then run the following query:
      DELETE from wp_comments WHERE comment_approved =  '0'

      If you want to remove ALL PENDING COMMENTS then run the following query:

      DELETE from wp_comments WHERE comment_approved =  '0'

      If you want to remove ALL APPROVED COMMENTS then run the following query:

      DELETE from wp_comments WHERE comment_approved =  '1'

      If you want to remove ALL TRASH COMMENTS then run the following query:

      DELETE from wp_comments WHERE comment_approved = 'trash'

      If you want to remove ALL SPAM COMMENTS then run the following query:

      DELETE from wp_comments WHERE comment_approved = 'spam'

In case your db prefix is not the default one(that is wp_) then replace the wp_ prefix I used with yours.

Mass Delete WordPress Comments using a plugin(or two :D)

Using phpMyAdmin for deleting comments from your WordPress site may be too complicated for some of you so I suggest to take a look on the following WordPress Plugins that will do the job nice and sleazy!

WPCommentCleaner
Delete Pending Comments

As always feel free to comment in case you need help or have a question(or even two)!

Makis Mourelatos

WC Athens 2016 co-organizer, WP Support and Security Aficionado, Wannabe Kitesurfer.

View Comments

  • Thanks for these tips. I'm keeping this one in my back pocket. Just had to do it on a site and wish I had known about all the different ways to do it. Will next time.

  • Went to visit one of my sites today and was greeted with nearly 9000 spam comments - nice - not!

    Had a look at the 'phpMyAdmin' section as suggested, but decided not to proceed. I might be able to do a little Photoshop, build websites etc., but as Clint Eastwood once said in one of his films "a man's got to know his limitations" or put another way, "a man's got to know when he's liable to bo*****s things up."

    That said, although clearly I'm not on Bill Gates top 10 list of world class web technicians - just the bottom 10, I have to say that I really do like one of the plugins you suggested, namely: WP Comment Cleaner, I downloaded it, plonked it on the site (that's non 'geek' speak for an upload) and voilà, (as you can see, I speak French too) I found a REALLY simply plugin that deleted those thousands of comments immediately - so thanks, that saved me a lot of time, it's probably one of the simplest, most effective plugins I've came across, which unlike some others, didn't take my site down with it. Thanks.

  • For non-technical Wordpress users: There is a free plugin called WPCommentCleaner which will remove all comments with just 1 click.

Share
Published by
Makis Mourelatos

Recent Posts

WordPress Theme Development

WordPress is a widely popular Content Management System (CMS) that powers over 40% of all…

12 months ago

WordPress Solutions

WordPress is a popular platform that empowers more than 60 million websites worldwide. Millions of…

12 months ago

WordPress Site Maintenance

In this article, we will cover ten crucial WordPress site maintenance tasks that every website…

12 months ago

WordPress Security Solutions

In this blog article, we will explore the various WordPress security solutions you can implement…

12 months ago

WordPress Plugin Solutions

Plugins are an integral part of WordPress, as they offer countless benefits and features that…

12 months ago

WordPress Optimization and Performance Improvement

In this article, we will explore various strategies that can help you enhance your WordPress…

12 months ago