I don’t know about you, but when I’m reading through comments and see a random link with text around it, it just feels out of place. At first I look at it and think “what the hell is that?” Then once I realize it is a pingback, I just move along. Don’t get me wrong though, I love pingbacks and trackbacks, they are what makes the blogosphere so great.
Just if only there were a way to separate those pingbacks and trackbacks from comments. Oh, wait! There is. The problem though, is that this will only work with a regular template. If you are using the plugin Brian’s Threaded Comments this won’t work. But, since I’m the “nerd that keeps on giving” I’ll set you in the right direction:
Do a search for this within your comments.php:
if($comment_type == 'comment') {
$GLOBALS['comment'] = &$comment;
write_comment($GLOBALS['comment']);
}
(it should be somewhere around line 137 if you didn’t make any changes)
Just after, add:
if($comment_type != 'comment') {
$backlinks = 'true';
}
(there should be another } after the code)
Right before:
<?php else : >
<p><?php _e('No comments yet.'); ?></p>
Add:
<?php
if($backlinks == 'true') {
echo '<h3>Backlinks</h3>';
echo '<ol>';
}
foreach ($comments as $comment) :
$comment_type = get_comment_type();
if($comment_type != 'comment') {
echo '<li>'.get_comment_author_link().'</li>';
}
endforeach;
if($backlinks == 'true') {
echo '</ol>';
}
?>
Of course, you can change <h3>Backlinks</h3> to whatever you want to call it.
This script will automatically add all the trackbacks and pingbacks after all the comments.
|
|
|
|
![]() |
| 2.8 |
If you enjoyed this post, please consider subscribing to my full feed RSS.
Written: Feb 5, 2008Tags: wordpress, wordpress comments, wordpress pingbacks, wordpress trackbacks
Related Articles:
Trackbacks VS Pingbacks
WP Plugin: Brian’s Threaded Comments with Author Highlighted Comments
How to Write Great Content and Keep Visitors Interested
Howto: Manually Install SezWho
WordPress Themes



Gary R. Hess






I think I will add this in soon. I agree that it can be frustrating to have pings in the middle of the comments, so thanks for this post! Stumbled.
Thanks for the stumble, Brian.
Hey Gary,
I want your opinion on this one….
Is it better to leave the trackback as a comment on the blog, or to delete the trackback?
I don’t mind the trackbacks from blogs that link to my post. But What I mainly concerned is from scrapers who scrap content and then link back to my blog post. Should I delete it? Ignore it? whats your take on this.
Here is a link to an example of a trackback that I am referring to. citimastercard.net/scammed-by-an-ebay-member/
-Jean Costa
Trackbacks don’t necessarily bring quality to your own blog, so if it is spam like a scraper, definitely delete it.
I let all non-spam trackbacks/pingbacks show. When you show the trackbacks/pingbacks, it is sort of an incentive. Some people, particularly those just starting out like to trackback/pingback to other blogs because it will show somewhere on the page and hope for a click through. It may also give more of an incentive to long-time members to link back because of this.