If you have ever used WordPress to create a Blog, you will quickly find out that more bots go to your site the actual humans interested in reading what you have to say. Recently I have a site up that has hundreds of thousands of Spam comments and I needed a way to get rid of all of them but unfortunately the
Screen Option is limited to only allowing you to see 999 records at a time. This is limiting if you have thousands of comments that you need to get rid of. How do you get rid of them then?
- Login to your server
ssh [email protected]
- Login got mysql
mysql -uroot -p
- Select your database to use
- Delete all the comments awaiting approval
DELETE FROM wp_comments WHERE comment_approved = 0
Warning this will delete all of comments that have not been approved.