Skip to content

Instantly share code, notes, and snippets.

@baczoni
Created April 24, 2012 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save baczoni/2481083 to your computer and use it in GitHub Desktop.
Save baczoni/2481083 to your computer and use it in GitHub Desktop.
Wordpress: Disable self trackbacks
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' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment