6/20/2015

How to Delete WordPress Trackback in Bulk using SQL Query

Leave a Comment
One of my client site recently got bombarded with lacks of spam comments, and most of them were trackback spam. My client was using Akismet plugin to stop spam comments on his blog, but for months he let the blog auto-approve comments. When he logged in back, there was almost 125,000 approved comments were there. There was no straight forward method to re-check all approved comments on WordPress for spam, and I looked out for solutions in forum, and couldn’t find any answer.
My goal here was to get rid of all the approved spam comments, and trackback from his blog.  I found one useful MySQL query, which deleted all trackback comments, and this helped me to reduced down the number of comments to 7500, from 125,000.
There are few things to know:
  • Few genuine trackbacks were also deleted using below mentioned query. Since, trackback doesn’t solve a real-purpose in this case, losing them was not a big problem.
  • If you are going to use this query, make sure you take a backup of your blog database.
  • This helped me to get rid of spam trackbacks, but didn’t helped me in getting rid of other approved spam comments. I’m still looking for a solution, else have to manually get rid of it.

Battling with WordPress trackback spam:

Very first thing you should do is, go to WordPress dashboard > Discussion and search comments using […] , it will show all trackback in your WordPress account.
search WordPress trackback
This will give you an idea about number of spam trackback you are about to delete. Instead of using PHPMyAdmin to run SQL query, I used Wp DB-manager plugin to run my query to get rid of all trackback.
Note: Do take a complete backup of your WordPress database before running this or any other SQL query.
Install Wp DB-manager plugin (You can use same plugin to take back up). Go to Run MYSQL query under WP DB-manager setting and run the query given after the screenshot:
delete WordPress trackback
DELETE FROM `wp_comments` WHERE `comment_type`=”trackback”
Run the above query, and all WordPress trackback will be deleted. Hope this will help someone, who is spammed by lots of trackback. If you still have any query, feel free to ask via comments.

0 comments:

Post a Comment