Created
July 27, 2016 14:14
-
-
Save ingozoell/70715ef1009a47030ce16b90dd551237 to your computer and use it in GitHub Desktop.
WP – Turn Off Self Pings http://www.wpbeginner.com/wp-tutorials/how-disable-self-pingbacks-in-wordpress/
This file contains hidden or 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
function no_self_ping( &$links ) { | |
$home = get_option( 'home' ); | |
foreach ( $links as $l => $link ) | |
if ( 0 === strpos( $link, $home ) ) | |
unset($links[$l]); | |
} | |
add_action( 'pre_ping', 'no_self_ping' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment