Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WP: Remove pings to your own blog
//remove pings to self
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' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment