How to remove pings

WordPress allows you to turn off pingbacks on your site. By using this option will disable pingback feature completely on your site.

Function 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

ABOUT AUTHOR

Nuno

I am a Freelance Web Developer and WordPress Expert based in London with a wealth of website development and support experience. I am great at problem solving and developing quick solutions.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • LET'S TALK!

    Fill in the form below to make an enquiry or find my contact details on my contact page.