WordPress

How To Disable Self Trackbacks

Wordpress

In WordPress when another blog links to a post it perform a trackback or a pingback this is to let the author know that another blog as linked to their content.

This is a very useful feature of WordPress and can help build a network around your blog.

The problem is if you link to your existing content within your post you too will also perform a pingback to your blog.

You can disable this feature by adding the following to your functions.php.

function disable_self_trackback( &$links ) {

    foreach ( $links as $l => $link )

        if ( 0 === strpos( $link, get_option( 'home' ) ) )

            unset($links[$l]);

}

add_action( 'pre_ping', 'disable_self_trackback' );
Back to top ^

Join Paulund

  • Get access to 100s of premium tutorials and downloadable content
  • Members content consists of Premium WordPress plugins, CSS packages, jQuery packages, tutorial demo files and templates for 100s of web development tutorials
  • In-depth development tutorials
  • Priority tutorial requests
  • Priority email development support
  • No ads

Here at Paulund you'll find Web Development tutorials and snippets focusing mainly on PHP, WordPress and CSS. Members will get access to premium tutorials that go into more detail about development with these languages. You will also get access to downloadable premium content based on the tutorial.

Join Paulund

Leave a Reply

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