Home / Disable Self Pingbacks
Duplicate Snippet

Embed Snippet on Your Site

Disable Self Pingbacks

Prevent WordPress from automatically creating pingbacks from your own site.

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

Comments

Add a Comment