by Claire Broadley
July 13, 2017
July 13, 2017

How to Delete WordPress Comments Awaiting Moderation

Over time, the number of WordPress comments in your database can grow at an alarming rate. On a popular blog, you could find yourself with thousands of comments sitting in the ‘Awaiting Moderation’ queue.

Unfortunately, WordPress provides no simple way of cleaning up comments. There’s a mass edit tool, but it’s not particularly versatile.

In order to deal with your comments, you’ll need to dive into the database. You must take a full database backup before proceeding.

Delete WordPress Comments Awaiting Moderation

Using phpMyAdmin (or the database tool provided in your hosting control panel), select your WordPress database.

In phpMyAdmin, click the SQL tab, and paste the following query in the box:

SELECT * FROM wp_comments WHERE comment_approved ="0"

This command selects all comments in the wp_comments table that have not been approved for publication. Review the results.

Next, enter this query:

DELETE from wp_comments WHERE comment_approved ="0"

This command permanently deletes all comments in the wp_comments table that have not been approved for publication.

Finally, in phpMyAdmin, run a Check and Repair on your WordPress database.

Image credit: premasagar.

About Claire Broadley

Claire has been creating websites for over 20 years and has been using WordPress for over ten. She is an expert in web hosting, design, HTML, and more. She lives with her husband and son in the United Kingdom.

Comments

Your email address will not be published. Required fields are marked *

avatar

e.politics: online advocacy tools & tactics » Taking Chances with Ones and Zeroes

September 16, 2008

[…] lived to tell the tale. Thanks to this guy for the […]

Guest

February 14, 2014