-
-
Save bewho/547b8e696609fcc26008d3eb7cbccc1d to your computer and use it in GitHub Desktop.
Disable self trackbacks from your own WordPress blog.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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