Want to know what WordPress Theme a site is using? Check Out Now!

How to Disable Self Trackbacks in WordPress?

Do you want to know how to disable self-trackbacks in WordPress?

Trackbacks become annoying when you start receiving links to one of your own posts on your own website. Therefore, it’s ideal to disable trackbacks in WordPress.

You can use the below code snippet to disable the self-trackbacks in WordPress.

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

Leave a Reply

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