53072_Delete Wordpress Comments Awaiting Moderation

Expand / Collapse


This article explains how to delete all Wordpress comments awaiting moderation.  This is useful for a Wordpress blog that has been inundated with spam and which is not using the Akismet plugin.


1. Once logged into the server and as the root user of MySQL, select the database as referenced in the wp-config.php file for the blog.  Navigate into that database via the MySQL command prompt by running:

use database <database_name>; (where <database_name> is the name of the database)

2. Run the following command to delete all of the unapproved comments:

DELETE FROM wp_comments WHERE comment_approved=’0';

Once run, all of the Wordpress comments awaiting moderation are immediately deleted.  This action is not reversible unless the database is restored from a good backup.

Rate this Article:

Category: Linux

Last Modified:Wednesday, October 26, 2011 4:44 PM


Level: Intermediate

Rated 5 stars based on 1 vote

Article has been viewed 6,005 times.

Email Article Email Article

Social Bookmarks Social Bookmarks