How to Disable Pingbacks and Trackbacks in WordPress

Many spammers used Pingbacks and Trackbacks to create spam content on your WordPress site. This tutorial will help you to disable pingbacks and trackbacks in WordPress. Also, remove old pingbacks and trackbacks from the database.

Step 1. Disable Pingbacks and Trackbacks

Use this option to disable pingbacks and trackbacks from new articles. Go to WordPress admin panel and then go Settings >> Discussion option. Now uncheck the box showing in below screenshot under Default article settings section.
Disable Pingbacks and Trackbacks

Step 2. Disable for Existing Articles

The above option will disable the pingbacks and trackbacks for new articles, but you still needs to disable it for existing articles. You can do this by directly querying the database. Change table name wp_posts with your table name if you are using a different prefix.
mysql> UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'post'; mysql> UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'page'; 

Step 3. Remove Pingbacks and Trackbacks

Finally, you need to remote Pingbacks and Trackbacks from existing articles. Use below query to remote it. You may need to change table name wp_comments if using different table prefix.
mysql> DELETE FROM  wp_comments WHERE  comment_type = 'trackback'; 

Thanks for Visit Here

Comments