If you have pingbacks switched on for your WordPress site i on new articles’) then one annoyance is ‘self pings’ when you link to one of your posts from another.
Well, self pings can be prevented with a simple script, added to your functions.php
file.
<?php | |
function no_self_pings( $links ) { | |
foreach ( $links as $loop => $link ) { | |
if ( 0 === strpos( $link, get_option( 'home' ) ) ) { unset( $links[ $loop ] ); } | |
} | |
} | |
add_action( 'pre_ping', 'no_self_pings' ); | |
?> |
And that’s it. There are no settings – just peace in your inbox.
- Settings -> Discussion and then tick ‘Allow link notifications from other blogs (pingbacks and trackbacks[↩]