Whenever a post is published WordPress automatically pings major Search engine bots and other services, also the sites mentioned in the Ping List to let them know that you have updated your website. It is all good and well but the problem comes when WordPress starts self pinging the blog. So today I will tell you how to disable Self Pingback or TrackBack
Self Pingback is when a blog pings itself or you can say it pings internally. well the easy way to understand is that you ringing the bell of your own home even when you at home. i.e. example.com/abc
pings to example.com/xyz
which is completely wrong because pingback is used when an external website mentions about your website i.e. domain.com/dfg
pings to example.org/abc
I hope you understood it well enough now lets come back to topic of How to disable self Pingback or Trackback, for that just open your functions.php and add the below code :
function disable_self_trackback( &$links ) { foreach ( $links as $l => $link ) if ( 0 === strpos( $link, get_option( 'home' ) ) ) unset($links[$l]); } add_action( 'pre_ping', 'disable_self_trackback' );
That is all, the above code is wrote by Paulund and he also made a plugin out of that code so you can also give the plugin a try.
The last thing I want to say is that Pingback and Trackback are different but almost works the same, Pingbacks are automated when a post is published, it pings to websites mentioned in a Ping List and Trackback is done when a post is manually mentioned in a different website, Like how I mentioned about Paulund in this post, that is a kind of trackback, for more information check the post by carmen about pingback and trackbacks she has mentioned it nicely with pros and cons of it.