Delete WordPress Spam Comments With PHPMyAdmin

By July 12, 2016Technology

I had a client who decided to go it alone and flip the blog functionality on and start a blog on their current company WordPress site. The simple error of not managing comments via a captcha or disabling them by default led to a whopping 49,560 spam comments in the span of less than a month. They were in the process of deleting them 25 or so at a time from the WordPress admin when they asked for help because their site kept crashing.

The problem is that if you have thousands of comments trying to load on a blog page, the page can be come unresponsive or not load at all. The other drawback is that these span comments can start to get crawled and hijack your post’s SEO about your cat and start to rank it instead about watches, viagra and cheap clothes from china and possibly¬†get your website flagged at potentially harmful or not trustworthy by Google and other search engines.

Anyone who works with MySQL or PHPMyAdmin everyday probably knows this, but here is a better way to delete comments. PHPMyAdmin had a feature called EMPTY (see the screenshot below) that will do the trick. Along with INSERT and DROP, EMPTY is one of the cooler and useful features when developing or managing WordPress sites. EMPTY will empty all the rows in table while leaving the table column structure intact. This is especially usefully for the wp-comments table in MySQL if you ever get spammed or just want to start over.

Once you get rid of your spammy comments, take the time to invest in a commenting captcha plugin or a plugin to disable comments all-together if your not that concerned like me. Hope this helps someone.

WordPress MySQL Drop Spam Comments