Disable Self Pingbacks

Disable Self Pingbacks and prevent your site from sending notifications to itself.

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

Post Comment