web analytics

Geeks Terminal

          Linux | Open Source | Web Hosting and more..

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.

 

The author is a Linux System Administrator and likes to blog.

Facebook Twitter LinkedIn Google+ 


Find helpful? Spread it!
Categories: WordPress

Comments are closed.