I connect a lot of my posts to my new ones, and that is probably why I keep getting self pingbacks. Besides a plugin, is there a script I can use to get rid of this?

2 s
2

You could try this by putting code in functions.php in your theme.

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' );

Hope this helpful to you.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *