How to remove pings

 In Functions

How to remove pings:

//remove pings
function ns_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’, ‘ns_no_self_ping’ );

 

source: 10 Tips optimize WordPress theme

Recent Posts

Leave a Comment

Start typing and press Enter to search