Wordpress Snippets

Batch Delete Spam Comments With Specific URL

Comment spammers are getting smarter and using latest techniques to fool anti-spam methods. It really does not matter which anti-spam plugins you use on WordPress, you must have noticed that these spam comments are bypassing your full proof system. Every now and then, you will receive bunch of spam comments on your website.

If you are receiving lots of spam comments from one particular url then it’s easy to delete them all in one shot.

You can run this simple SQL query through your PHPMyAdmin, that detects the spam comments containing the desired URL in the comments table and delete all of them at once.

# batch delete spam comments with specific url
DELETE from wp_comments WHERE comment_author_url LIKE "%spam-domain%";

If your database prefix is different from wp_, don’t forget to change it before running this SQL query. And of course, create a backup of your database before you try anything on your database.

Hire Us. Or just say Hi!
Need a job? Apply to get one.