X

Disable self trackbacks

WordPress trackback system makes sure that other blogs are noticed when you link to them. This is a great way to get more users, since a link to your post will be displayed on the target website.

Problem is, when you link to one of your own posts, on your own website, a trackback will be displayed although the link is coming from you.

To disable this, put the snippet in functions.php.

Code Snippet:

<?php
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' );
?>

Comments  Leave a Reply

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!