Fixing WordPress Pingback Issue For AddThis and Sphere

March 5th, 2008
Bill Lazorik

Recently I discovered that the AddThis and Sphere plugins were causing a Pingback issue in WordPress. When I sent a ping to one of my own posts the data that appeared in the comments was jumbled and filled with text from the two plugins. The comment that occured appears below:

[…] Google Health Service Enters Pilot Stage addthis_url = ‘http%3A%2F%2Fwww.wlazorik.com%2F2008%2F03%2F04%2Fgoogle-expands-
health-reach-with-
investment-in-gene-sequencing-project%2F’; addthis_title = ‘Google+Expands+Health+Reach
+With+Investment+In+Gene+Sequencing+Project’;
addthis_pub = ‘??????′; Sphere […]

Even after disabling the plugins I still saw the text for the trackback url of the post appearing in the comment. Some of the issues may be related to my theme, but if you are experiencing a similar issue the fix is easy. Simply wrap the code for the plugins and the trackback url in an html paragraph tag <p></p>. This will prevent the text from being sent along with the pingback. Below are the sections of the single post theme file, AddThis, and Sphere plugins which I edited:

Single Post Theme File

<p><a href=”<?php trackback_url(); ?>” rel=”trackback”>Trackback URL</a></p>

AddThis Plugin File

function social_widget_badge($link, $title){
$pub = $this->addthis_username;

$badge = “<p><script type=\”text/javascript\”>\n”;
$badge .= ” addthis_url = ‘$link’;\n”;
$badge .= ” addthis_title = ‘$title’;\n”;
$badge .= ” addthis_pub = ‘$pub’;\n”;
$badge .= “</script><script type=\”text/javascript\” src=\”http://s7.addthis.com/js/addthis_widget.php?v=12\” ></script></p>\n”;

if ( $title == ‘About+Bill+Lazorik’ || $title == ‘Projects’ || $title == ‘Contact+Bill+Lazorik’ ) {
$badge = ”;
}
return $badge;
}

Sphere Plugin File

function get_sphereit_link( $link, $content=NULL ) {

// did we get some content to check?
if (!is_null($content) && !enableSphereItLink($content)) {
return “”;
}

$content= “<p><span style=\”margin-bottom:40px; border-bottom:none;\”>”;
$content.= ‘<a class=”iconsphere” title=”Sphere: Find Related Content” onclick=”return Sphere.Widget.search(\”;
$content.= $link;
$content.= ‘\’)” href=”http://www.sphere.com/search?q=sphereit:’;
$content.= $link;
$content.= ‘”> Sphere</a>’;
$content.= “</span></p>“;

return $content;
}

Feel free to test your pingback configuration by adding a link to this blog in your post.

Trackback URL

One Comment

Comment Feed: RSS 2.0
  1. 95Ambrose Says:

    Hello admin, i must say you have very interesting posts here.
    Your website should go viral. You need initial traffic
    only. How to get it? Search for; Mertiso’s tips go viral

Leave a Reply