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.

<?php
/**
 
 * Disable Self Trackbacks in WordPress
 
 *
 
 */
 
function disable_self_ping( &$links ) {
    foreach ( $links as $l => $link )
        if ( 0 === strpos( $link, get_option( 'home' ) ) )
            unset($links[$l]);
}
add_action( 'pre_ping', 'disable_self_ping' );
?>
It's only fair to share...Share on Google+Tweet about this on TwitterShare on Facebook

Posts you may like: