It’s a Ping Thing, Removing “Self-Ping” in WordPress

2 Comments

WordPress PluginsOne early notification feature of WordPress (and some other blog/cms platforms) was the “ping”.  Borrowing its name from the unrelated utility used to test the availability and responsivity of IP Addresses, the WordPress ping notifies authors and site moderators if another, pingback-enable site has linked to one or more of their articles.  WordPress can even generate an entry in the original post’s comment section showing the pingback.  You may have seen these on blogs that are heavily referenced by other sites.

Site moderators are often of differing opinions regarding ping comments. Some enjoy the information and believe the presence of public comments lend credibility to their content in the eyes of visitors (Hey, lots of folks are referencing this information…).  Others believe ping comments clutter live, on-site discussion.

A side-effect of the ping process is the “self-ping”. This occurs when a new article on a site reference/links back to a different, pre-existing article and a comment is automatically generated.  These can be disabled without affecting external ping comments in one of two methods.

If you’re comfortable editing PHP code, the following snippet, added at the end of your theme’s functions.php file will disable self-pings. As with any changes to your WordPress site, we strongly advise performing a backup prior to make any significant changes.

//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' );

For the more faint of heart, there is a plugin that will accomplish a similar effect.

Name: No Self Pings

Author: mdawaffe

Discussion: http://wordpress.org/tags/no-self-ping?forum_id=10

Need help implementing this plugin in your WordPress site?  Contact us for our professional services.  We can also provide support & expertise in convenient “blocks” to suit your short and long term needs.

 

 

 

 

I'm the front-man of It's WordPress. I come from a diverse array of backgrounds, enjoying the opportunity to expand my knowledge base and skill set by re-inventing myself. I enjoy environments that focus on emerging information, technology and concepts. I put on the technical hat in my early 20s and never really looked back. I'm love technology and the internet, as well as the outdoors and avidly hike, kayak and camp every chance I get.

About Us

We can take you from concept, through design, development and deployment in one seamless process. Whether you choose a self-managed web site or need a continuing support relationship; we've got you covered.

Request Consulation

Ready to transform your vision into a reality? Just looking to see what it takes to get the ball rolling. Tell us about your project and we can help. No spam. No obligation. Just answers.

More from our blog

See all posts