Created
November 14, 2017 15:59
-
-
Save dartiss/120a42eda1998f64b77d32e1fff6fc67 to your computer and use it in GitHub Desktop.
No Self Pings
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 | |
function no_self_pings( $links ) { | |
foreach ( $links as $loop => $link ) { | |
if ( 0 === strpos( $link, get_option( 'home' ) ) ) { unset( $links[ $loop ] ); } | |
} | |
} | |
add_action( 'pre_ping', 'no_self_pings' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add to your WordPress
functions.php
to prevent your site from self-pinging when you add a link to one of your own posts.https://artiss.blog/2017/03/preventing-self-pings/