How to delete mass comments in WordPress?

wordpress-logoIf you have Akismet plugin active and your blog is getting lots of spam comments (moderated by Akismet) then you can execute a small query from the phpMyAdmin to delete bulk spam comments instead of manual deletion.

 

 

 

 

1) Open the database in phpMyAdmin

2) Backup the database using export option from phpMyAdmin for safety purpose.

3) Open the MySQL query window and execute following command

delete from wp_comments where comment_approved = "spam"

Note: please replace above query with the database prefix the database is using

4) Once the query is executed check the comments option from WordPress admin.

 

MySQL queries to delete mass  spam , trash, pending, approved comments from WordPress

To delete all pending comments:

delete from wp_comments WHERE comment_approved = 0

To delete all approved comments:

delete from wp_comments WHERE comment_approved = 1

To delete all trash comments:

delete from wp_comments where comment_approved = "trash"

To delete all spam comments:

delete from wp_comments where comment_approved = "spam"

 

If you face any problem and have any other trick to share kindly post as comment.

 

Share on Facebook5
Share on Google+3Tweet about this on TwitterShare on StumbleUpon0Share on LinkedIn0Share on Tumblr0Digg thisPin on Pinterest0Share on Reddit0Email this to someonePrint this page

About Abhijit Sandhan

Abhijit Sandhan
Loves Linux, Blogging, Traveling, Hiking and sharing knowledge!

Leave a Reply

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

CAPTCHA