Home » Labs » Disable Self Trackbacks in WordPress  

Disable Self Trackbacks in WordPress

Filed under Labs

WordPress has a great inbuilt function known as trackbacks which is make a notification when blogs links together. This is a best way to get more users. But in some case we need to disable self trackbacks, and here is a code for doing this job easily. Just copy and past it into your functions.php and your WordPress will disable self trackbacks.

 * Disable Self Trackbacks in WordPress
function disable_self_ping( &$links ) {
    foreach ( $links as $l => $link )
        if ( 0 === strpos( $link, get_option( 'home' ) ) )
add_action( 'pre_ping', 'disable_self_ping' );

Posts you may like: