WordPress Tutorial

How to Delete WordPress Comments

How to Delete WordPress Comments

WordPress comment spam is becoming an issue for every webmaster. If you do not have any spam protection setup on your WordPress blog, one day you might find yourself with thousands of spam/pending comments laying inside your website. This tutorial will explain how to easily delete all unnecessary comments from WordPress website.

What you’ll need

Before you begin this guide you’ll need the following:

  • Access to WordPress Admin area
  • Access to phpMyAdmin

Option 1 — Deleting WordPress comments using phpMyAdmin

Login to your hosting control panel and access phpMyAdmin. Inside phpMyadmin, select your WordPress database (see this tutorial to find out your WordPress database name) and click on SQL tab in order to run a query.


IMPORTANT: To prevent unwanted data loss, it’s strongly recommended to create backup of your MySQL database before running any queries.

Depending on what you want to achieve run the following queries:

Remove all pending comments in WordPress:

DELETE from wp_comments WHERE comment_approved =  '0'

Remove all spam comments in WordPress:

DELETE from wp_comments WHERE comment_approved = 'spam'

Remove all approved comments in WordPress:

DELETE from wp_comments WHERE comment_approved =  '1'

Remove all trash comments in WordPress:

DELETE from wp_comments WHERE comment_approved = 'trash'

Note that depending on your WordPress setup, the prefix of comments table (wp_ in this case) can be different.

Simply copy and paste the query you want to run into the SQL tab and press Go button.

WordPress Delete Pending Commends using phpMyAdmin

Option 2 — Deleting spam comments via WordPress Admin Dashboard

Login to your WordPress Admin Dashboard and navigate to Comments -> Spam section. You will be able to see Empty Spam button and by clicking it you will delete all comments on your WordPress flagged as SPAM.


Option 3 — Deleting pending comments using WordPress plugin

One of the easiest ways to delete all Pending comments is by installing WordPress plugin called Delete Pending Comments.
You can easily install this plugin by navigating to your WordPress Admin Dashboard and clicking on Plugins section. Inside Add plugins section, search for Delete Pending Comments plugin and install it. For more detailed tutorial how to install WordPress plugins click here.

Once installation of the plugin is complete access Comments -> Delete Pending Comments section. Copy and paste security phrase into the text field and press Delete Pending Comments button.

WordPress Delete Pending Comments Plugin


Congratulations, you have learned how to remove all unwanted comments in your WordPress blog. This can be very helpful while dealing with automated spam comments on your website.

About the author

Merkys M.

Merkys is a server administrator and Linux expert at Hostinger. He keeps everything up & running while tackling advanced server management issues. Besides that, he’s a big fan of blockchain technology, web development, and bodybuilding.


Click here to post a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Hello Merkys, you have described great ways to remove the unwanted comments from the WordPress blog or website. I, however, believe that it is good to remove the plugin from WordPress default admin section. It’s really easy. Removing comments through the PHPMyAdmin is the best way but it needs some technical knowledge of MySQL. While removing the comments with the help of plugin can decrease your website speed as it needed you to install another specific plugin for a small task which can be managed from WordPress admin dashboard.

Get Exclusive Content

Join thousands of webmasters who get our free newsletter with tips on how to drive more traffic and revenue to their websites!

Please wait...

Thank you for sign up!

More in WordPress Tutorial
How to Clean up Infected WordPress Using WordFence Plugin