close
deletecommentswp

On rare occasions you might want to delete all your comments from the site and it is practically impossible to delete them one by one so this is where deleting all the comments at once can spring into action.

Before you Delete All WordPress Comments

There can be many cases after which you can feel the need to delete all the comments from your site.

First you need to create a complete WordPress backup of your site.

Deleting all comments in WordPress is an irreversible action. You will not be able to undo it once you have deleted those comments. This is why it is important that you have a .

Method 1: Deleting All WordPress Comments Using Plugin

First thing you need to do is install and activate the Delete All Comments plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, you need to visit Tools » Delete All Comments page. This is where you will see the total number of comments on your website, a confirmation box, and the delete button.

deleteallcomments

Clicking the delete all button will permanently delete all comments from your WordPress site. Including those in spam and trash.

You can now visit the comments page, and you will see all comments safely deleted from your WordPress site.

Method 2: Delete All WordPress Comments Using phpMyAdmin

You can also quickly delete all WordPress comments using MySQL or phpMyAdmin. This method is only recommended for more advanced users.

Login to cPanel dashboard of your WordPress hosting account. Under the database section, click on phpMyAdmin.

phpmyadmincpanel-1

Inside phpMyAdmin, you will need to locate your WordPress database. You will see a page like this showing all your WordPress database tables.

emptycommenttables

Check the box next to wpprefix_comments and wpprefix_commentmeta table. The name of your comments tables may differ depending on the table prefix you choose during your WordPress installation.

After selecting comments table, locate the ‘With selected:’ drop down below the table list and select ‘Empty’ from the drop down menu.

PhpMyAdmin will now show you a warning asking if you really want to empty those tables.

deletecommentsphpmyadmin

Click on the yes button to continue. This will delete all WordPress comments from your database.

You can also delete all WordPress comments using MySQL console (command line). Simply log into your MySQL console and run this command:

1TRUNCATE `wp_commentmeta`;

 

2TRUNCATE `wp_comments`;

 

 

 

Tags : wordpressWordPress how to
Nooruddin Ahmed

The author Nooruddin Ahmed

An avid football fan. Lives for the weekend game.Aviation enthusiast. Believes in letting bygones be bygones.

Leave a Response