Disable self pings with pre_ping hook

Adding this snippet to the functions.php of your wordpress theme will disable self pings to your blog.

 

 

function no_self_ping( &$links ) {
$home = get_option( 'home' );
foreach ( $links as $l => $link )
if ( 0 === strpos( $link, $home ) )
unset($links[$l]);
}
add_action( 'pre_ping', 'no_self_ping' );

Be Sociable, Share!

Leave a comment