WordPress

3 Easy Ways to Delete all Comments in WordPress Website

If you are a WordPress website owner and you do not get time to check your website regularly then you might know that it is a pain to get rid of unapproved comments. Also, there are some WordPress websites, which get more spam comments due to many reasons, and it becomes a tedious task to delete all comments at once. Unfortunately, there is no option available to clear all unapproved comments at one go and you have to go through each and every page to delete them. On the top of that, there is no option to increase the number of comments being displayed in a section to make the deleting process easier. You have to manually traverse through each comment on the page and delete them. If you feel that maintaining a website is so difficult then you can consult one good WordPress website development company to make this easy. You don’t need to worry any of the security issues which comes in the form of spam comments or hijacking your website.

There are solutions to this problem. In this article, we are giving you three easy ways to delete all comments at one go in your WordPress website.

Delete All Comments Through SSH

This method is for those who persons who have in-depth technical knowledge. You need to log in via SSH and use the command line. It is extremely easy to delete all the comments through this method.

You need to be more careful while making this operation because there are more chances to delete another table or DB if you provide a wrong table or DB name. Use the correct details in all the following commands to make the process easy and smooth.

Follow the below steps to delete all comments using SSH and during this operation, you will be asked to provide the password for the Database. So please keep it ready.

  1. Log in to your website server via SSH .To delete all the comments that you would want to delete at one go, type the following command in the command prompt:
    mysql -u DB_USERNAME -p DB_NAME -e “DELETE FROM wp_comments WHERE comment_approved = ‘1’;”
  2. Then if you wish to delete all the spam comments write the following command:
    mysql -u DB_USERNAME -p DB_NAME -e “DELETE FROM wp_comments WHERE comment_approved = ‘spam’;”
  3. Also, if you want to delete or remove the trash comments, then you can type the following command:
    mysql -u DB_USERNAME -p DB_NAME -e “DELETE FROM wp_comments WHERE comment_approved = ‘trash’;”
  4. Also, if you want to delete or remove the trash comments, then you can type the following command:
  5. mysql -u DB_USERNAME -p DB_NAME -e “DELETE FROM wp_comments WHERE comment_approved = ‘0’;”

To Delete All Comments Through PHP Myadmin

You can delete comments using PHPMyAdmin. Follow the below steps if you are using cPanel as your control panel to manage all your websites. If not, below steps may vary through PHPMyAdmin.

  1. Log in with your personal credentials ‘username’ & ‘password’ to cPanel account and from here select phpMyAdmin in the database section.
  2. Select the name of your database from there and click on the SQL tab. A command prompt window will open.
  3. To delete all comments type the following SQL query in the command prompt:
    DELETE from wp_comments WHERE comment_approved = ‘0’;
  4. To delete all other approved comments, type the following command:
    DELETE from wp_comments WHERE comment_approved = ‘1’;
  5. To delete the spam comments, run the following query:
    DELETE from wp_comments WHERE comment_approved = ‘spam’;
  6. To delete or clear the trash comments, type the following command:
    DELETE from wp_comments WHERE comment_approved = ‘trash’;

To Delete All Comments Using a Plugin

You can also delete all the comments with the help of plugins. There are a variety of plugins are available in the plugin directory to make your work relatively easier. In many case themes and plugins will make your website awesome.

For example, you can install ‘Delete All Comments’ plugin. After installing this plugin, in the comments section of WordPress, there would “Delete All Comments” should come up. When it opens, then click on that particular option and you will be asked if you want to delete all the comments. And after that, you could click on “delete all comments” option. All the pending comments will be get deleted. This is a much easier and faster way to delete all your comments from your WordPress website.

Latest posts by Selvan Tamilmani (see all)
Selvan Tamilmani

Selvan is a working partner for the company Pattronize InfoTech. He spends most of the time in internet to do research on SEO and guides lot of local people for their local business. You can find Selvan on Twitter, LinkedIn and Facebook.

View Comments

Recent Posts

FreshBooks Accounting Software: Review, Features, Benefits, and Pricing

FreshBooks is a very popular cloud-based accounting software.  Freshbooks accounting software is used by all…

1 month ago

35+ Best Blogging Tools and Resources To Blog Like A Pro

Blogging is not an easy job. As a blogger, you not only need to write…

3 months ago

A2 Hosting Coupon Codes – Save 86% Off on Plans

Are you looking for A2 Hosting Coupon Codes ? Well, you have come to the…

3 months ago

Sell Gift Cards Online : Maximize Their Value and Get Instant Cash

If you’ve got a stash of unused gift cards lying around, you might be wondering…

3 months ago

Social Snap Review – An Ultimate Social Media Toolkit

There's no denying it. At the point when social media works, it can change your…

4 months ago

Dropshipping With AI : Is DropGenius Right For You?

The USP DropGenius offers is the power to be able to launch a profitable dropshipping…

10 months ago