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?


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 ) )
add_action( 'pre_ping', 'no_self_ping' );

Hope this helpful to you.


I used a no trackback plugin for a few years (and I forget which one, there are a few available); it did seem silly to ping myself. Then I decided it was more like a way to connect posts, and stopped using it.

For a small amount of code, it's probably not much of a tradeoff between plugin or to try the code above. As an alternative to changing the theme, for a few projects especially on multisite where I do not want to alter themes others might use, I have used the My Custom Functions plugin to add small bits of code w/o having to mod functions.php


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.