Skip to content

Instantly share code, notes, and snippets.

@glueckpress
Created January 17, 2012 22:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save glueckpress/1629455 to your computer and use it in GitHub Desktop.
Save glueckpress/1629455 to your computer and use it in GitHub Desktop.
Disable self trackbacks from your own WordPress blog.
<?php
// Retrieved from: http://wp-snippets.com/disable-self-trackbacks/
add_action( 'pre_ping', 'disable_self_ping' );
function disable_self_ping( &$links ) {
foreach ( $links as $l => $link )
if ( 0 === strpos( $link, get_option( 'home' ) ) )
unset($links[$l]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment