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

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.

CLICK TO EDIT

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.

WordPress Workflow With Rest API

Over the last decade we've seen the accelerating rise of dynamic JavaScript…
Continue reading

Three Must-Haves For Your WordPress Headlines

Simple headline best practices you can't afford to overlook. Don't bury the…
Continue reading

Hail to the King (of Content Management Systems)!

WordPress continues to grow as the CMS (Content Management System) of choice on…
Continue reading

Theme View – Cool Free Themes For WordPress Sites

In this post we look at three free themes that use the…
Continue reading

A Fist Full of Facebook… Plugins

Love or hate it, Facebook is still the 800 pound gorilla in…
Continue reading

Modifying the WordPress Admin Toolbar

The Admin Toolbar was introduced back in WordPress 3.1 (trivia points if…
Continue reading

Defer Ads by Date on WordPress Post and Pages

The topic of advertising on a website can be a sensitive one.…
Continue reading

Theme View – Cool Free Themes For WordPress Sites

In this Theme View update we feature themes that take advantage of…
Continue reading

Leave a Comment

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

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

Leave a Comment

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.

Scroll to Top