Alright, so most of the guides out there don’t actually tell you how to delete comments labeled spam, they only tell you how to delete all comments that are unapproved. That there is a big difference is obvious
Difference Between Unapproved And Spam Comments
Unapproved comments that were cleared by Akismet and are not considered Spam can include a lot of legit comments, so it’s not a good idea to simply run a query to delete all unapproved comments. Instead, you need to delete all comments labeled spam by Akismet
DELETE from wp_comments WHERE comment_approved = 'spam'
1. Make sure to change wp_comments to yourtableprefix_comments
2. Make sure to run “Optimize table” after running the query to clean up the table
Removing Comments Stuck In Trash
Have you already deleted a great deal of comments yourself or a plugin moved them there? Then use the following query:
DELETE from tableprefix_comments WHERE comment_approved = 'trash'
Removing Comments That Are Not Approved: CAREFUL!
If you decide you want to get rid of all comments that are not approved, including those that are PENDING and could include LEGIT comments, then run this
DELETE from wp_comments WHERE comment_approved = '0'