3 Ways to Remove WordPress Self Pings

3 Ways to Remove WordPress Self Pings

A self ping is when WordPress sends pings from your own site to your own site when you link to your own posts. They can appear in your comments area. If you’re annoyed by self pings, here are three quick ways to turn them off:

Method #1: Turn them off in your functions.php file:

Add this to your theme’s functions.php file:
{code type=php}//remove pings to self
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’ );{/code}

Method #2: Install the No Self Pings plugin:

The No Self Pings plugin does exactly what the code above in method one does. It’s just in plugin form instead of you having to add it to your functions file. Some people like to keep fewer plugins. Others would rather not have to edit a PHP file. Take whatever solution suits you.

Method #3: Install the Disabler plugin:

I recently wrote about the Disabler plugin and you can read more about what it does here:
Daily Tip: Disabler Plugin Helps You Turn Off Unwanted WordPress Settings in One Click.
This is very handy for turning off a number of settings all in one plugin.