How to Delete WordPress Bulk Comments Using phpMyAdmin

September 6, 2024 / WordPress

This article illustrates how to delete WordPress bulk comments using phpMyAdmin.

Using this method, you can remove WordPress comments from your database in bulk.
Regardless, this approach necessitates database and SQL knowledge, therefore it is best left to those with experience in IT.

There are two ways in which phpMyAdmin can remove comments:

  1. Running an SQL query
  2. Emptying the comment table

You will alter the two tables, “wp_comments” and “wp_commentmeta,” where comments are typically found in both of the aforementioned options.
(Those names might have prefixes added to them in some databases.)

For example, “my_website_wp_comments”

Executing a SQL query:

Execute the subsequent inquiries in accordance with your needs. (Replace the “wp_ prefix” used in the following queries with your own if your database prefix differs from the usual one, “wp_.”)

  1. To eliminate NON-APPROVED or ALL PENDING COMMENTS
    1DELETE from wp_comments WHERE comment_approved = '0'
  2. To eliminate ALL APPROVED COMMENTS
    1DELETE from wp_comments WHERE comment_approved = '1'
  3. To totally eliminate ALL TRASH COMMENTS
    1DELETE from wp_comments WHERE comment_approved = 'trash'
  4. To eliminate ALL SPAM COMMENTS
    1DELETE from wp_comments WHERE comment_approved = 'spam'

Take note that the WP Bulk Delete plugin performs the same function behind the scenes. These are all irreversible actions.

Using phpMyAdmin:

You can use this way to remove all comments in one go, without any restrictions.

  1. Launch cPanel on your hosting.
  2. Access “Database Tools”. Choose “phpMyAdmin.”
  3. Decide which database you wish to edit. Navigate downward. Choose the “wp_commentmeta” and “wp_comments” options.
  4. Right-click on the “wp_comments” table, choose Empty, then press Yes to remove every comment. Selecting “enable foreign key checks” is not a crucial decision.

In this manner, you can delete WordPress bulk comments using phpMyAdmin. If you liked our article, you will surely love our support.