PurabTech is technical blog for Programmer and Coders
automatically delete spam comments in wordpress
WordPress Spam comments is big issue. I am getting daily 5k spam comments daily. we automated task of deleting spam comments automatically. Daily going to comments dashboard and deleting spam comments is really boring task. WordPress Akismat wordpress plugin does good job of finding spam comments.
automatically delete spam comments in wordpress
How to automatically delete spam comments in wordpress?
I am using Akismat wordpress plugin for my all wordpress blogs. It does good job of finding spam comments. Due to spam comments. comment-meta table becoming big and causing mysql resource issues. So cleaning comments table became necessary. so we used following hook in wordpress theme code.
Notes:
The number of blogs is hardcoded (3000)
Add above code in functions.php file.
If you want WordPress to automatically empty my spam comments after 1 day. Just add this to wp-config.php. Following code will automatically Empty Your WordPress Trash