For those of you that have just recently installed WordPress and begun blogging or have an existing blog that is picking up speed, you may notice an inflated amount of spam in your comments due to fraudulent trackbacks sent by people just trying to get a link from your site.
If you are as annoyed by this as I was today, I’ve found the solution that you should use to take care of the problem. Since I don’t like using plugins for a simple problem that can be fixed manually, here is my method you should consider using.
In your web hosting control panel (cPanel, Plesk, Webmin, or whatever CP you have), make a full backup then go to PHPMyAdmin and run the following SQL command on your database:
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'post';
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'page';
If you have custom post types installed on your WordPress, then you’ll also need to run this on your CPT posts:
UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'yourcptnamehere';
This will disable trackback spam on all of your posts and pages on your website without you having to go under each post and page and manually update which can be quite the chore. The SQL command is run under the SQL tab on the very top of your PHPMyAdmin after going under your WordPress database.
If you changed the default table string when setting up WordPress, you’ll need to change wp_ to whatever you changed the table string to. For most, wp_posts is correct. On the left of this post, I attached a screenshot of PHPMyAdmin with wp_ highlighted so that you can make sure you are using the right UPDATE setting when you run the UPDATE SQL command.
If you have something besides wp_posts, like wordpress_posts, then you’ll run the following command instead:
UPDATE wordpress_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'post';
UPDATE wordpress_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'page';
The last step is you’ll need to disable trackbacks by default on your site for all new posts and pages you create. To do this, go to Administration > Settings > Discussion and uncheck the box “Allow link notifications from other blogs (pingbacks and trackbacks).”
Note to remember: Updating the discussion setting in your WordPress will not disable pingback and trackbacks to your existing posts and pages that had it enabled before you adjusted this setting. You’ll still need to update your database to disable it on all of your posts and pages.
Now you’ll have less spam in your SPAM folder to wade through when doing your periodic cleanups.