Separating Trackbacks from Comments

Footsteps in the sand. Trackbacks are the messages displayed in the comments list whenever another blog links back to one of your posts. Many blogs disable trackbacks, but not all.

If you use trackbacks on your blog, it is best if they are not mixed with the comments. The comments are a conversation between between real people. Having machine-generated links in the middle of that will only serve to disrupt the conversations.

The method described here will lift out all of the trackbacks, and then display them as a numbered list after the list of comments is finished. Once you have this done, customizing the trackbacks to appear however you want them to is simple.

And thanks to Gary, the Trackbacks header will only appear if the post has a trackback to show.

NB – This method will only work for WordPress users. Sorry guys!

How To Separate the Trackbacks

Open comments.php, and search for the following line:

<?php foreach ($comments as $comment) : ?>

After it, paste the following:

<?php $comment_type = get_comment_type(); ?>
<?php if($comment_type == 'comment') { ?>

Now look for:

<?php endforeach; /* end for each comment */ ?>

And before it, paste:

<?php } else { $trackback = true; } /* End of is_comment statement */ ?>

That means that your list of comments will continue to display as normal, but without any trackbacks or pingbacks. Now we will add a second comments loop for the trackbacks.

Look for the following line:

<?php else : // this is displayed if there are no comments so far ?>

And before it, paste this: (The “Trackbacks” title line can be deleted if you don’t want a heading to be shown)


<?php if ($trackback == true) { ?>
<h3>Trackbacks</h3>
<ol>
<?php foreach ($comments as $comment) : ?>
<?php $comment_type = get_comment_type(); ?>
<?php if($comment_type != 'comment') { ?>
<li><?php comment_author_link() ?></li>
<?php } ?>
<?php endforeach; ?>
</ol>
<?php } ?>

Of course, this is all only helpful if you actually use trackbacks, and there are some good reasons for either side of that debate. Do you use trackbacks on your blog? Why?

Share

  1. goldfries (81 comments)18 September 07

    Strange, I get notified about trackbacks and I do see them on my WPadmin Comments section but it doesn’t appear on my posts’ comments section even without any modifications.

    Did I miss out something?

  2. Your theme may already be set up to block them out. :)

    If they appear in your comments area, it does mean that they’re enabled and have been saved as post comments.

  3. redwall_hp (139 comments)18 September 07

    I’ve been meaning to do this for a while now, but I haven’t decided whether I should put trackbacks above or below comments.

  4. It depends on the blog Matt, but on Webmaster Source you follow each post with a list of related posts. You wouldn’t want to have that followed immediately by another list of links.

  5. sarahG (15 comments)18 September 07

    I used to kill trackbacks due to them being 99% spam, however I switched them back on as I think it’s good to have a link to other posts mentioning yours. Trouble is I’ve broken it all now and they don’t seem to appear!

    Separating them is a good idea. I’ve seen it in the past and it does make things flow better :)

  6. Hah. I was JUST wondering how to do this after stumbling across another blog that did so.

    Thanks for the practical advice. You’ve once again confirmed that I need to stay subscribed to your feed.

  7. Sarah – Morally I do think it’s nice. I don’t use them here though because they aren’t necessarily links that I recommend. If there is going to be a list of links, it should be a hank-picked list that I have chosen specifically for my readers. (I suppose that’s more of a problem for smaller blogs, like this one. Larger blogs probably get a lot nicer trackbacks! xD )

    Liberty – Yes! You must always stay subscribed. For ever and ever and ever! :p

  8. Slevi (73 comments)18 September 07

    Nice little guide :) , since I don’t get many trackbacks I don’t think it’d really matter in which way I display them to begin with though :P . By far the most avid trackbackers for my blog are spammers, hehe. Those are nicely being blocked from public of course.

    But I’ll keep this in mind for if it ever would occur that I would start getting a lot of them ;) .

  9. I hope that that will be the case someday Slevi. For 2 reasons. ;)

  10. WordPress is so messy with its PHP in the HTML. I wonder how long it will take for a new higher grade blogging software to knock them of their spot?

  11. I like that aspect of it David. It gives you complete control over the design through only the templates files. Very rarely have I had to touch the actual WP’s files. At the very least, it makes upgrading easy.

  12. I use a much more complicated way of doing this, but it allows me to count them separately and run totally different loops for them.

    My comments.php is huge because of all this :P

  13. Slevi (73 comments)19 September 07

    @David: Probably very long, the majority of the users simply couldn’t care less about messy code. Living proof of that is mySpace, it has even the shittiest page source and I highly doubt their backend is much better but meanwhile it is one of the best visited sites in the web.

    As inefficiently wordpress might be doing a couple of things currently, the amount of people actually caring about it is just too small to make a change.

  14. Connor – You can do that with this code as well. I originally set it up on this blog, where we do count the comments, and it’s already running two seperate loops.

    Of course, the nice thing about coding is that there are always a few ways to achieve the same goal. ALl are equally valid. :D

  15. Yay it worked! Thank you!

    I never managed to get the author coded different color one to work (for some reason my email address isn’t recorded when I myself comment? hmm) but this one worked :) . Thanks!

    One small question: if I wanted it to say something innocuous like “Trackbacks:” before the list of trackbacks, where would I write that (and how) in the code to do that?

  16. I like seeing them separated on other blogs, and I’ve been thinking about doing it one mine. I just haven’t made the time to do it, so thanks for the reminder.

  17. One thing I like about using the Sandbox theme as a basis for custom WordPress themes is that separation of comments and trackbacks/pingbacks is built into it.

    I like to reward commenters and linkers, so I have removed “nofollow” from my blog and feature a recent trackbacks list on my home page (as well as recent comments). I definitely believe in showing trackbacks!

  18. Nice! I’ve seen this once or twice on blogs and thought it was kind of cute.
    Perhaps I will do this on my blog, even though I get very few trackbacks!

    Michael Martine with an E – I started making a theme based on Sandbox and found the code to be so bloated and messy that I didn’t know where to start! How do you find working with it?

  19. paidtwice – Glad it helped! Sorry to hear the author one didn’t work so well. The code does work, but I may have been a little grey with some of the instructions. I’ll just have to be more clear in future!

    To add the “Trackbacks” heading, look for the last section that you pasted in, beginning with:

    <ol>
    < ?php foreach ($comments as $comment) : ?>

    Before that, paste the following:

    <h3>Trackbacks</h3>

    That will do it. :)

    Steven – No problem. :)

    Michael – First off, I love the name! Secondly, it’s a nice thing to show trackbacks like that. I have nofollow removed here, but not the trackbacks. I’m a little worried about their impact on SEO, and that they mightn’t always be overly relevant links. :(

    kristarella – It’s always an option! There’s no need to do it, especially if you aren’t showing trackbacks at the minute anyway, but if you are, I think it’s a good way of doing it.

  20. Thanks! That worked great!

    No worries on the author color comment thing, I am not skilled at coding… anything. :) I may have messed something up. I intend on trying again :)

    Future topic suggestion…. how you make your columns start lower and extend your header on that one part to put that quote in. That would rule (if I could figure it out that is lol).

  21. Glad it worked! :)

    Thanks for the idea, but it would be a little harder to explain. It’s actually quite easy to do (For a coder that is), but because every theme is so different, it wouldn’t be as easy as copying&pasting. You would need a basic understanding of CSS I’m afraid, to work out the specifics for your own theme. :( (I do plan on writing some articles that would give you that basic understanding in the future, but not just yet!)

  22. goldfries (81 comments)20 September 07

    Arrggh. I just found out it appeared in one of my post. :) This post of yours is going to be useful. ;)

  23. Well, it will if it works! ;)

    *fingers crossed*

  24. I totally agree with you, it’s always best to seperate trackbacks and human comments.

  25. Laarni (4 comments)21 September 07

    I’m going to try this. :) Thanks.

  26. Moses – Agreed. Combining them only leads to confusion and annoyance.

    Laarni – Glad to hear it. Good luck! (Let me know if you have any problems. :) )

  27. JHS (4 comments)22 September 07

    Hi there: I started to implement this and then discovered that there is verbiage in my theme indicating that pings/trackbacks and comments are already separated. But the trackbacks are not appearing. How can I tell if they have been disabled and how do I allow them again? I am getting e-mail notifications of them and they are included in my total comment count, but they don’t actually appear on my site.

    Thanks.

  28. You’re using a modified Copyblogger – I found that code in my theme too (also Coppyblogger). I don’t think that the function separating them is activated by default in CB – from Chris’s comment about it. Are you sure that your trackbacks are not showing up as comments? Perhaps they can be excluded from the admin?

    In light of the function not being active you could probably still use this code and leave that over code alone (I’m thinking of doing that).

  29. Wow, great tip, I was just looking into how to do this. you’ll definately be getting a trackback from me in this weekends Sunday Seven edition!

  30. JHS (4 comments)22 September 07

    Kristarella: I love what you’ve done with the CB theme!

    Unfortunately, this won’t work for me because the language referenced is not in the comment.php file, so I don’t know where to start to implement this work around.

    I’m sure . . . my trackbacks and pings are definitely not showing up at all except in my dashboard.

    Thanks.

  31. Thanks JHS, I appreciate the compliment :)

    I think I found the code – look for:
    <?php $count_pings = 1; foreach ($comments as $comment) { ?>
    and
    <?php $comment_number++; } /* end for each comment */ ?>

    They should be the places that you need to put code after and before respectively, according to Michael’s instructions. I haven’t tested it, so make sure you back up your comments.php incase it doesn’t work.
    The ‘php else’ code that you place the trackback code before is the same.

    p.s. Sorry in advance if that code doesn’t show up properly – I never know how WP processes these things!

  32. JHS – If they had been disabled, you wouldn’t get any notification of them. Let me know if Kristarella’s advice works for you. If it doesn’t, I’ll try out the copyblogger theme myself and see what needs to be done.

    Kristarella – Thanks for helping out! :D

    Suzanne – Thanks! Hope it works out for you.

  33. No worries :)
    I’m trying out your code right now with the code that I just mentioned and it seems to be working – just needs a bit of styling. However, my trackbacks were showing up as comments, so I’m not sure what’s happening there.

  34. Oops – unclear comments – I meant my trackbacks were showing up before, so I don’t know if what I’ve done to my file will work for JHS.
    Anyway, it’s all working nicely. Thanks for the instructions!

  35. No problem. If they were showing up before then the code above should definitely work, if you’ve tweaked it for Copyblogger. :)

  36. JHS (4 comments)22 September 07

    I tried placing the code where Kristarella suggested.

    You can see the result here:
    http://www.jhsiess.com/hereslo.....-on-track/

    You see 5 comments there.

    But if you go to the homepage, you will see that under the post excerpt (it is the last post on the front page), the verbiage is “17 Comments.”

    I use the Better Comments Manager plugin and I have a total of 17 comments, pings and trackbacks there.

    So they are coming in, but are not showing up.

    Thanks for any assistance you can provide!

  37. JHS (4 comments)22 September 07

    Kristarella: Would you be willing to share your comments.php file with me? If you e-mail it to admin@jhsiess.com, I can compare your file with mine and perhaps figure out what’s going on.

    Thanks.

  38. I see what you mean JHS, that’s weird the 17/5 comments thing. There is a chance that a plugin is causing that Even though the plugin doesn’t really have anything to do with trackbacks. How much do you actually use that plugin?
    I can email you my comments file. No problem.

  39. I use the Better Comments Manager too and it doesn’t hide my trackbacks. But I run a different theme so it may not matter. lol

  40. Just wanted to say thanks again Kristarella, and paidtwice now. It’s good of yous to help out. :)

  41. Tay (2 comments)24 September 07

    Thank you, thank you, THANK YOU! :D I’ve just implemented this on my blog and it worked perfectly. I appreciate you sharing this advice.

  42. No problem Tay. Glad it worked for ya. :)

  43. I just got back from vacation and am now catching up on your articles. Thanks Michael! I’ve pasted the codes and they are working perfectly. I was wondering whether it is possible to put a custom message immediately above the Trackbacks? I tried that but this message also comes up in posts without trackbacks.

  44. Hey pablopabla,
    I’m not great with php, but I think I have what you’re looking for.
    <ol class="trackbacks">
    <?php foreach ($comments as $comment) : ?>
    <?php $comment_type = get_comment_type(); ?>
    <?php if($comment_type != 'comment') { ?>
    <h3>Trackbacks ↓</h3>
    <li><?php comment_author_link() ?></li>
    <?php } ?>
    <?php endforeach; ?>
    </ol>

    In the h3 tag I’ve got my Trackback title, which should only show up when there are trackbacks (because it’s after the “if” thing. You could put whatever you want there.

  45. Thanks Kristarella.

    However, I notice that the “Trackbacks” wording repeats itself for each and every Trackback on the posts. :O

  46. Bother! You are absolutely right. I actually have so few trackbacks that it was difficult to find a post with 2 on it! (I guess I’m hoping for more in the future :P )

    In that case, I too would like an answer to the question!

  47. Hey pablopabla! Nice to see you again. :)

    I’m going to add that into the post now. Another commenter asked the same question. You can read my answer here in the meantime. :)

    Kristarella – Incase you’re interested: the problem with yours is just that the foreach(… line is the start of a loop. Everything between that an endforeach is repeated for every item (trackback) on the article. :)

  48. That’s a good idea!
    But, do you have an example?
    A screenshot of the results would be very helpful in deciding if I’m going to use that.

    (I most likely will, but a screenshot will be helpful)

  49. Yep, the articles on SkellieWag display trackbacks like this. :)

  50. Thanks so much!
    I am going to use that now!

  51. No problem. Let me know if you have any problems. :)

  52. pablopabla (50 comments)1 October 07

    Thanks for the tip Michael. However, is it possible to further tweak it so that the customisation (the line between the ) does not appear at all when there are no trackbacks to a post? At the moment, the customisation appears in all posts.

    :D

  53. Gary (4 comments)19 October 07

    Thanks for the great tip on trackbacks.

    To have the trackbacks showing only if there are some is quite easy change to make…following your original instructions, instead of this:

    Do this:

    And instead of this:

    Trackbacks

    Do this:


    Trackbacks

  54. Michael Martin (1319 comments)19 October 07

    Hey Gary – Thanks for trying to help out, but there’s no code in your comment. Did something go wrong? :(

  55. Gary (4 comments)19 October 07

    Hey Michael

    Hmm, seems to have gone wrong. No matter, see http://www.osworld.biz/1004/se.....-comments/

    Cheers, Gary

  56. Michael Martin (1319 comments)19 October 07

    Looks good now, thanks. :)

  57. Forrest (25 comments)21 November 07

    This is fantastic … thanks so much for the tip! I’ve seen a lot of blogs doing this and always wondered how. I agree they interrupt the flow of conversation, but I’ve been told by people smarter than I am that trackbacks are helpful.

    One question, though, since I don’t know that much PHP … how would I make the text Trackbacks and the ordered list underneath it only show up when there are more than zero trackbacks?

  58. kristarella (141 comments)21 November 07

    Hey Forrest – this is a really great solution. I agree that trackbacks interrupt the comversation.

    See Gary’s comment for the solution to that issue. I’m using his code on my blog.

  59. Hehe – You must be subscribed to this post Kristarella. Thanks for helping Forrest out. :)

  60. Forrest (25 comments)27 November 07

    I guess I should have read all of the comments first…! Before I came back and saw that, I implemented more or less the same thing in javascript, but this is a cleaner solution overall. So for the second time thanks!

  61. lol – I wonder if Kristarella will pop in to say “Welcome” :D

  62. kristarella (141 comments)27 November 07

    I usually only come back when someone has an issue that they’re trying to solve ;)

  63. Fair enough. I’m just glad you do. :D

  64. Thanks for this tip, it’s helped :)

    One thing though. My site keeps on making trackbacks to itself whenever I link back to another article of mine. Can I stop it from doing this? I’m using WP 2.3.2

  65. Michael Martin (1319 comments)4 January 08

    Nathan,

    I’ve disabled trackbacks here, so I can’t say anything for certain, but this plugin looks good. If you try it, let me know if it works please. :)

  66. Thanks for the link Martin, and yes the plugin does work, for all you people out there with the same problem. :)

  67. Michael Martin (1319 comments)5 January 08

    Nathan, glad to hear it and thanks for letting us know (I’ve bookmarked it now ;) )

  68. Forrest (25 comments)5 January 08

    WordPress automatically sends itself trackbacks, and auto-publishes them.  I go back and delete them manually;  occasionally I’ll actually want to let one remain.If a reder discovers my blog through an old post, [self] trackbacks are a good way to connect that post to other specific ones on the same subject, or that refer to it in a meaningful way.  My post on The Gorge is a good example.Food for thought, anyway…

  69. Michael Martin (1319 comments)5 January 08

    Forrest, that would work as well, and it does give you more control over the process, but I think that having to manually delete a link every time I interlink my posts would bug me, and probably put me off interlinking. :( (Though perhaps encourge me to link out more instead?)

  70. Forrest (25 comments)6 January 08

    My blog gets scraped a bit.  It sounds like that’s been more of a problem either in the past or for other people, but it’s at least an annoyance.In a recent interview, Matt Cutts said that when Google sees the same content showing up on ten pages on ten different sites, but nine of them link back to one that doesn’t link out to any of the others, they assume it’s scraped, and transfer any pagerank the copies might attain to the original.  ( He wasn’t clear about whether you need to link to the specific page or just back to the domain the original was published on? )It’s neighborly to link out, but I wouldn’t let the trackbacks stop me from linking back to earlier posts.

  71. Michael Martin (1319 comments)6 January 08

    Forrest, it sounds like the sort of thing that Google would be able to do (How hard can it be to catch on that a site is a splog?). They’re also becoming a lot more consious of the time that content showed up on certain sites, so if you publish an article first, and then splog rips it a few days later, Google should have found it on your blog first hopefully. That might stand for something.

    And if you’re willing to take the time, then the manual way is great. I’m just a little lazy I suppose. With WP in the backend, I like to automate as much as possible. :D

  72. kristarella (141 comments)6 January 08

    Well, I got a little lost in this conversation. I think I got the gist though… I’ve had a few of those slightly dodgy trackbacks. Where the blog looked like nothing more than copying sections of text with a link to the author. One of them was extremely dodgy and caled me “americanshopper” rather than “kristarella”!

    Should I delete all trackbacks that don’t look useful to me?

  73. kristarella (141 comments)6 January 08

    BTW, not sure about this WYSIWIG comment editor. It’s a good idea, but it didn’t keep some of my line breaks just then, and it seems to insert some extra code that I get as plain text in emails when subscribed to comments.

  74. Michael Martin (1319 comments)7 January 08

    Kristarella – Yes, I’d delete the spammy trackbacks. Linking out to a spammy site is going to annoy your readers if they click the link, and could hurt you in Google (If it associates you with that spam site).

    But I love the WYSIWYG! I haven’t had any problems with it yet (Bar some teething problems in IE7, which should now be fixed).

    The line-breaks you lost, were they multiple line breaks in a row? If so, I think that was WordPress, not the editor. :(

  75. kristarella (141 comments)7 January 08

    Haha, ok.

    I’d just hit enter a couple of times, I don’t know what WP usually inserts there.

    See how it goes this time. ;)

    Edit: oh, it didn’t work. I’ve added all those breaks manually. Normally hitting enter adds a break or ends a paragraph, unless you turned it off. Curious. Maybe just my browser.

  76. Tip Diva (1 comments)7 January 08

    Spectacular – works great! Thank you!

  77. Michael Martin (1319 comments)7 January 08

    Kristarella,

    Hmm, what browser are you using? I’ll try it out as well.

    Tip Diva – Glad it worked for you. :)

  78. kristarella (141 comments)7 January 08

    I was using Camino the last couple of times.Now I’m trying Safari.

  79. Michael Martin (1319 comments)7 January 08

    I’m in Safari now. Let’s see how it goes.

    I don’t have Camino though (Windows user). :(

    EDIT – It left out the line breaks on me as well. I’ll head over to the support forums to see if anyone else has had this problem.

  80. Michael Martin (1319 comments)7 January 08

    And now that I’ve added more code;

    Will

    This

    Work? :)

    (Sorry about the emails Kristarella! xD )

    EDIT – The line breaks worked for me now. What about you?

  81. cekay (1 comments)20 January 08

    Thank you very much for this information. Found it via google cause it’s annoying to have a trackback look like a comment. your hack works exactly as i wanted it!

  82. Corrina (1 comments)29 January 08

    THANK YOU for this post! It was making me crazy that my trackback’s were coming in as comments. Now that’s all fixed. :-)

  83. Michael Martin (1319 comments)29 January 08

    Glad it worked for yous :)

  84. Looks great, but I get a W3.org invalid page error. Do you know how to fix this?
    end tag for “ol” which is not finished
    Most likely, you nested tags and closed them in the wrong order. For
    example <p><em>…</p> is not acceptable, as <em>
    must be closed before <p>. Acceptable nesting is:
    <p><em>…</em></p>

    Another possibility is that you used an element which requires
    a child element that you did not include. Hence the parent element
    is “not finished”, not complete. For instance, in HTML the <head> element
    must contain a <title> child element, lists (ul, ol, dl) require list items (li,
    or dt, dd), and so on.

  85. to add to the above, it seems to only validate if there are either no comments and no trackpacks, or if there are both comments and trackbacks.If there are one and not the other on the post, then I get the invalid error above.

  86. kristarella (141 comments)2 February 08

    Millionare Money Habits – are you sure you’re implementing the code correctly?

    I’m using this method and I don’t get validation errors. Here’s the output from a page that’s got lots of trackbacks. There are errors, but they’re all for a plugin that has nothing to do with this.

  87. kristarella (141 comments)2 February 08

    By the way, dig the new sidebar Michael. It’s really useful and easy to read.

  88. Michael Martin (1319 comments)2 February 08

    Millionaire Money Habits – The problem is that the original code put out some code, regardless of whether the post had any trackbacks or not.

    I’ve updated it now though, thanks to Gary, with a few new lines that will fix that. The easiest way to fix your code would be delete the changes you made the other day (Sorry!), and then run through the post again.

    Sorry for the hassle. I should have made that update a while back :(

  89. Michael Martin (1319 comments)2 February 08

    And Kristarella, thanks. There’ll be a post up about it in a day or 2. :D

  90. Thanks Michael. I made the changes, but still get the W3C invalid response on posts that only have trackbacks and now comments.

    Post that only have comments and no trackbacks are validating now, so there’s progress.

    Thanks!

  91. Michael Martin (1319 comments)2 February 08

    MMH – Ahh yes, that problem would remain. There’s no easy way around that one. The only method I can think of is pretty messy and would involve running through all of the comments twice, just to check if there were any comments.

    How important is the validation to you? It can’t be very often that you get a post with trackbacks but no comments, and the fix for those occasions would be putting on needless extra server load in every page. :(

  92. I guess it’s no biggie – i’m just being anal in having my pages validate for SEO purposes.I guess the easy thing to do would be to just add a comment to those posts. Thanks for all the help and quick replies!

  93. Michael Martin (1319 comments)2 February 08

    SEO purposes? I don’t think that W3C valid code will have any impact on your SEO.

    It might impact it if the errors were so bad that the search engines couldn’t make sense of your page, but with a tiny error like this, there’s nothing to worry about. :)

  94. Oh, ok. I didn’t realize that. I thought it mattered for SEO. Thanks again!

  95. Michael Martin (1319 comments)3 February 08

    No problem. See you around. :)

  96. milo (72 comments)4 February 08

    Hum, I guess what comes around will come around.

    Coincidense…

  97. Ramil (1 comments)1 March 08

    Thanks for the nice tip. I will implement this on my blog design.

  98. Michael Martin (1319 comments)2 March 08

    milo,
    Sorry, I didn’t see your message before. But ack well, this code has been spread about in plenty of places by now. :(

    Ramil,
    No problem. Glad ya found it useful. :)

  99. Merci (1 comments)8 March 08

    Thank you Michael for sharing your tips. I wanted to do this for some time. I am so glad your instructions were clear and precise, it worked on the first try.Cheers and more power to you and your blogging!

  100. Michael Martin (1319 comments)9 March 08

    Merci,
    I’m glad it worked for you, and that it was easy enough to follow! :)

  101. Adam Kayce (2 comments)12 March 08

    Oh, perfect! Like a charm.It was the “don’t show it if I don’t have any” that I was looking for, and this worked like an absolute charm.Thanks so much.

  102. Michael Martin (1319 comments)12 March 08

    Adam,
    I like that as well. No need to mention trackbacks at all on a post that doesn’t have any. :)

  103. Fabian (2 comments)16 March 08

    Thanks for this article, you explain it really clearly.:)I’ll do this on my blog too, although it isn’t really necessary yet, I don’t get a lot of trackbacks and pingbacks.

  104. AJ (6 comments)19 March 08

    I’m loving this little trick. Really clearly explained. I never really get trackbacks, but it still is pretty usefule :)

  105. Michael Martin (1319 comments)19 March 08

    Fabian and AJ,
    Ahh well. Just look forward to the times when you do get a lot of trackbacks, and a trick like this is needed. :D

  106. dinsan (3 comments)28 March 08

    Thanks .. it worked very well :)   

  107. djstelios (1 comments)28 March 08

    Very good hack. I’ve used it on my blog and now I like more the comments area. It’s cleaner..Thanks

  108. nice tip,thanks

  109. Brandon (2 comments)28 March 08

    Thank you very much… this was very easy to follow and worked perfectly.

  110. elena (3 comments)2 April 08

    Thanks for the tip..nice work and site looks too nice

  111. Mohit (2 comments)2 April 08

    explaination is very clear and understandable

    thanks

    good luck

  112. Michael Martin (1319 comments)2 April 08

    No problem everyone. Let me know if you have any trouble with it.

  113. Fay Webber (1 comments)15 April 08

    Thanks for this article;

    this is very useful and very clear – easy to use

  114. Epic Alex (9 comments)30 April 08

    This is a great tutorial, thanks a lot. I’m just off to implement it now.

    I’ve wanted to do this for a while, as trackbacks take up as much space as a comment at the moment, and people(ie me on other blogs) tend not to be as interested in them.

    Thanks again

  115. Hey thanks this worked for me!
    Thanks very much, I spent a long while searching how to fix this and this was the easiest one and it actually worked. I appreciate it very much.

  116. DazzleCat (8 comments)8 May 08

    ive been reading this blog a while but this is my first comment. thank you for your article and your views

  117. Cristian (1 comments)15 May 08

    Great post. I’ve searching for this, and is really good explained. Thanks.

  118. Divvy (5 comments)24 June 08

    Great tip, thank you so much!!!

    Btw, is there any code that makes possible to not count the trackbacks/pingbacks in the number of comments?

    For example, in a post I have 5 comments.
    1 for a user and 4 trackbacks.
    I only want to show 1 comment instead of 5 comments.

    Is possible? how? :)

  119. Michael Martin (1319 comments)24 June 08

    Divvy,
    This plugin should do the trick for you: http://txfx.net/code/wordpress.....ent-count/

    (Can’t guarantee it works on the latest version of WordPress though. The comments on that post are just full of spam sadly.)

  120. Divvy (5 comments)25 June 08

    arghhhhhhh almostttttttttttt…..
    Is not working 100%, only appears the value, dont appears the word “comments”.

    Appears for example “0″
    Insteat of “0 comments”

    Michael Martin, please can you give a look at the code for me? please? :)

    If not, well, thank you anyway, it was a great help, better then nothing hehe

  121. narendra.s.v (3 comments)25 June 08

    thanks a lot! it worked for me but now i wanna use a ajax reply plugin and i tried to find those line in comment.php file but there is no lines :(

  122. Michael Martin (1319 comments)25 June 08

    Divvy,
    Just add the word “comments” in after the plugin code. :)

    Narendra,
    Is it the plugin that you can’t install? Or the trackbacks script?

    I’d be surprised if your comments.php file didn’t have the lines I’ve mentioned in the article. It would have to be extremely different not to have them.

  123. Divvy (5 comments)25 June 08

    I am really duhhhh lol
    Thank you Michael Martin :)

  124. Divvy (5 comments)25 June 08

    Michael Martin, I dont want to abuse of my luck but……..

    Can you take a look at the plugin code for me? To find a way to make for example “0 comments” clickable, or in another words, make that as a link like “http://www.domain.com/post title/#comments” or “http://www.domain.com/post title/#respond”.

    I really appreciate your help :)

  125. Michael Martin (1319 comments)25 June 08

    Divvy,
    Just put the plugin code inside a regular link then. :)

    E.g.
    <a href="<?php the_permalink(); ?>/#comments"><?php comment_type_count('comment'); ?> comments</a>

  126. Divvy (5 comments)25 June 08

    You are the MAN! Thank you so much mate! :D

  127. This is very intresting!

  128. thanks, very nice tips !!

  129. Hey very useful tips, I had one blog where I had trackbacks enabled and the comments were huge., so I have just been disabling them since.

  130. Paul Johns (1 comments)26 August 08

    Thank you SO much for this post. I tried about 3 different ways before this, 2 of which worked, and none which were standards compliant when there were no trackbacks. This was easy to implement and customize. Thanks!

  131. rap (2 comments)14 September 08

    Yay it worked! Thank you!

  132. Arjen (13 comments)30 September 08

    Thanks,

    It’s a very easy solution, and it looks much better now on my blog!

  133. Good tutorial was easy to follow and implement.

  134. Sumesh (39 comments)5 October 08

    Useful tutorial – I just tested it and works perfectly.

    Instead of having a separate trackback area, I used only the code to remove it from the comments loop – I’m done with trackbacks. Rarely do I get genuine trackbacks, in any case (I also removed the RDF-something HTML comment for autodiscovery). I also moved the comment form above the comment loop – I think it would solicit more comments.

  135. Thanks for posting this solution, just implemented on my blog – looks great! I always wanted to separate comments from trackbacks…

    Max’s last post How To Build Blog Making $100+ a Month on Autopilot Under 3 Weeks – Part 1

  136. I’m thinking of actually removing trackbacks altogether. I think they add clutter – your site looks nice and clean without them. Hmmm….

  137. Joel (3 comments)31 October 08

    Thanks! Worked great for my site!

  138. Anna (3 comments)3 November 08

    Thank you very much, worked great!

  139. KjgUiuon (1 comments)7 November 08

    http://goblenod.net H8jjGFDRlivb54sdREfds
    a

  140. Blogshop (1 comments)9 November 08

    step by step thank you in mind for if it ever would occur that I would start getting a lot of them

    :-)

  141. Jo (3 comments)22 November 08

    Didn’t think when you wrote this over a year ago someone would still be happy to find it did you? You did? I knew you would :D Follow you via RSS and this post was just what I needed. Working on the li factor now to list the Trackbacks, but at least I have them now! Bravo! Thanks :D

  142. Jo,
    Haha, nope! I had no idea just how popular this post would turn out to be. The fact people are still reading it and implenting it amazes me! One of the most useful I’ve written I guess! :D

  143. Anil (3 comments)25 November 08

    Thanks for posting this solution , worked great!

  144. i agree with your opinon. thank you for this post. very intresting. i like it.

  145. Great tutorial! I used your technique on a couple different blogs, and it worked like a charm for me! Thanks so much for you help.

  146. Nice Tips
    Thank you for Share This

  147. tom (10 comments)19 December 08

    So Cool Tips, Thank you

  148. smith (1 comments)20 December 08

    Thanks very much .. it worked ok.

  149. Rap (2 comments)26 December 08

    thanks, very nice tips !!

  150. Oh, perfect! I learned it

  151. Hi Michael,

    About time some made a plugin for this (hint hint).

  152. Hikari (3 comments)6 February 09

    tnx for the original tutorial, much apreciated!

  153. That worked like a charm – thanks for putting that together!

  154. thx for this great tutorial, im gonna test it on my new blog, :)

  155. fascinating and communicative, but would be suffering with something more on this topic?

  156. Nice tips! thanks

  157. This tutorial was exactly what I needed.
    These small fixes here and there all around the blog can make such a big difference. This is exactly what I felt about the readability post also man! Wow! simple and thorough!

  158. Thank you – nothing like a good trackback in the middle of a comment *conversation* – nice work.

  159. Deepak (4 comments)24 February 09

    thanks for this post.I now know what is trackback.

  160. Elvis (1 comments)24 February 09

    keep up the good work!

  161. Praveen (1 comments)25 February 09

    I don’t know about trackbacks but now i know about trackbacks and there use.Thank you.

  162. Care Egypt (1 comments)21 March 09

    i was looking for this
    thank you so much

  163. Tomstricks (4 comments)22 March 09

    Thanks for this information rich tutorial.This is an asset for newbie bloggers

  164. Nippy (1 comments)27 March 09

    I put up my first personal blog yesterday and found this really helpful. Thanks for sharing. Where does everybody get the time?

  165. Design Jar (3 comments)9 April 09

    Ive been looking to separate the two for a while now so thanks for creating a post on this subject.

  166. Krish (1 comments)20 April 09

    Very nice information. Thanks.

  167. Jan (1 comments)25 April 09

    Hello Michael,

    first of all great explenation and great overall tutorial structure.

    To answere your question, i do use trackbacks because i think it’s a nice and very easy way to get to know the people browsing your site, reading your content and actually finding it helpful.

    I do not have many trackbacks on my site but i will definitly change that in future ;)

    Again, great article!

  168. Raymond Selda (2 comments)11 May 09

    Thank you for putting up this tutorial. Works like a charm in my blog.

    Raymond Selda’s Latest Post: Create A Tabbed Content Rotator Using jQuery

  169. pchieng (1 comments)14 May 09

    Wow. That worked perfectly! It actually makes the Trackbacks look a lot better on my blog :)

    pchieng’s Latest Post: Lake Miramar Loop 5 Mile Run

  170. baloot (11 comments)18 May 09

    I can’t find these code for my Thesis theme..
    Another alternative, I must use the plugin.. :p

    baloot’s Latest Post: Reezluz Goes Wild. Jom Baca Post Terpilih Di Blog Reezluv (Info Bisnes, Grafik dan Teknologi)

    • Michael Martin (1319 comments)19 May 09

      lol – Good point – You don’t get this level of control over your Thesis theme, or if you did, you’d lose the changes each time you upgraded. :(

  171. Tom (10 comments)23 May 09

    Sorry, stupid question here:

    Where is the comments.php file found?

    I have found 2 comment.php (no “s”) one in the includes and one in the admin, but I can’t find comments.php (with the “s”)

    Neither of the comment.php files have the text I’m supposed to find.

    Thanks for any help on this basic question!

    Tom

    • Michael Martin (1319 comments)24 May 09

      Hi Tom,
      It will be in wp-content/themes/your-theme-name . That’s the folder that contains all your theme files. If you ever need to edit anything to do with your design, it will be in one of the folders in there! :)

      You never edit the files in wp-admin or wp-includes because your changes would be overwritten when you next upgrade WordPress.

  172. slim b (1 comments)3 June 09

    nice! thanks :)

  173. Ben (18 comments)5 June 09

    Thanks, I used one of your trackbacks to work out how to put it before the comments :)

    Ben’s Latest Post: Windows Update Won’t Work After Updating to Service Pack 3

  174. Ivy (1 comments)15 June 09

    Thanks for this, it helps wonders! Now to fix up the CSS.
    .-= Ivy´s last blog ..Beautiful British Columbia =-.

  175. tatil (1 comments)18 June 09

    thank you very good …
    .-= tatil´s last blog ..Çeşme Otel Yeni =-.

  176. Accura Cast (1 comments)9 July 09

    That is some beautiful code!
    Thanks ever so much
    .-= Accura Cast´s last blog ..Google Annihilates Microsoft, Yahoo! In Mobile =-.

  177. harryandlou (1 comments)15 July 09

    Thank you very much for this! Very, very helpful.

  178. Gustavo (1 comments)22 July 09

    Thank you for the very usefull code !
    .-= Gustavo´s last blog ..Como usar trackbacks e personalizar comentários no wordpress =-.

  179. rap dinle (1 comments)22 July 09

    im gonna test it on my new blog
    thanks

  180. Scrooby (1 comments)27 July 09

    Thanks for sharing! I’ve been looking to implement this onto my blog for a while now but never bothered, now after stumbling across this post, I have added it and it’s great! Such a simple method of making your blog look so much better. Thanks!

  181. maskoko (3 comments)29 July 09

    thats’s right..!
    .-= maskoko´s last blog ..Bikin Abi malu wae.. =-.

  182. Well done.
    Very good tip :)
    Thanks

  183. salenco (1 comments)15 August 09

    Nice tutorial but I have a problem: I can´t find in comments.php. I´m using Wordpress 2.8.4 with the last Cutline template with one right column.

    I´d like a lot to separate comments and trackbacks, please tell me how I can do it.

    Thanks for reading.

  184. Imran (1 comments)16 August 09

    I guess this does not work anymore. Because WP 2.8+ has removed the loop with wp_list_comments()

    You either need to define your own comment listing function or edit comment_templates.php in wp-includes folder

  185. Joe (5 comments)19 August 09

    I just added the code to my comments file. Works great.

    I had to add some css padding to get the trackbacks in line with the title -mostly specific to my theme though.

    Thanks much.

  186. abipiella (1 comments)24 August 09

    ouye mobility radeon hd 3470 driver :\ zti
    kepoj conexant modem driver =(( pkq
    yrgrz ageia physx driver ? tek
    fbwih kx audio driver :#() hdgu

  187. Avery (11 comments)31 August 09

    Personally,I like php,but I never mind to put trackbacks and comments together.The key point is content.So I just focus on the content.

  188. dnmtnk (1 comments)10 September 09

    Thanks for sharing! I’ve been looking to implement this onto my blog for a while now but never bothered, now after stumbling across this post, I have added it and it’s great! Such a simple method of making your blog look so much better. Thanks!

  189. In WP 2.8.x i try using this:

    wp_list_comments(‘type=comment’); <= for comment
    wp_list_comments('type=ping'); <= for pingback

    just in 2 lines code, more simple :D

  190. Sooran (2 comments)15 September 09

    tancks.
    This Post Helped me
    Good Time

  191. Tentu saja akan menjadi semakin

  192. lynnscott (20 comments)29 September 09

    Great Post….I will down load and let you know ….I value you’re information…Thanks..

  193. Ezuca (1 comments)3 October 09

    Thanks for this cool tutorial. I have been searching the net for this but only got those for the older versions of WP. Thanks again.

  194. You can also use a tab element to separate the comments and trackbacks in another way if you wish. This would just be a different visual way to separate it. I found that some people really like tabs(myself for one). Tabs helps to consolidate a lot of information into on small area if space is an issue.

  195. Roy61 (1 comments)22 October 09

    Ask how long the benefits will last. ,

  196. Robomaster (23 comments)23 October 09

    Great tutorial! Yup, it gets really annoying when there’s a bunch of comments and then a trackback sitting in between them.

  197. Boy69 (1 comments)23 October 09

    Were physicians to use this same logic they would end up in the lawyer’s office every day. ,

  198. I always wonder about track backs, i always use it but never study the original purpose and advantage a track back can give separately from the comment that we use to simply convey a message to the post opener about how we get the post and how much we liked it and other stuff, anyone help me telling something about track backs.

  199. It would be great to exclude the trackbacks from the comment count as well :)

  200. This will come in very handy when im designing a new skin for my blog.

    I do use trackbacks on my blog but I never actually put much thought into why but I guess if someone is nice enough to link to me, I want to be nice and trackback.

  201. Nice coding… thanks for making life simple…

  202. Mezanul (4 comments)11 November 09

    Thanks Michael, it helped me a lot.. I have now a more cleaner page with the comments neatly separated from the trackbacks.

  203. Umar (2 comments)27 November 09

    Hi,

    Nice howto, its work great.

    Thanks

  204. Thank you so much for this! I thought you explained things very well. A lot of bloggers assume everyone knows a lot about coding and things, and don’t take the time to explain exactly where to put things, but your instructions were very simple and exact and made things very easy, even for those of us who are still learning! Again, thank you!

  205. Autai ptfe (17 comments)30 December 09

    Great Poster !!

  206. Dennis (7 comments)12 January 10

    This saved me alot of time, good post!

  207. I do use trackbacks on my site, this post is very useful.

    I’m going to start going into my comment.php file and setting this up right away.

  208. Thanks! I was using IntenseDebate and I thought it wouldn’t work there, but now I quit ID system so I’ll try it out

  209. Erm, I just went to try it, but the only code you told to search that I found in my comments is “”

    I don’t have “” and

  210. lol, it doesn’t show between “”. I mean I only have: in my comment, I don’t have the other two parts of the code.

    Please, delete my others comments, sorry about that :(

  211. Really great blog thanks for share information.

  212. Anna (3 comments)19 January 10

    Thanks for this. I just implemented this on my blog.

  213. Writing a trackback thing that integrates pretty interesting I think.

  214. I love the fact that people like you take the time to explain things so clearly and simply. @ minutes work and all my comments are now sooo much tidier!

    cheers dude!

  215. Very useful! I’ve just implemented it! Thank you very much for sharing!

  216. Kaplang (1 comments)26 January 10

    This is just what I need :) thanks

  217. sikiş (2 comments)30 January 10

    Personally,I like php,but I never mind to put trackbacks and comments together.The key point is content.So I just focus on the content.

  218. Thanks for the tuto mate I’ve just implemented this on the blog of one of my customers and it worked like a charm. So thanks again for sharing and have a nice week end :)

  219. Depending on the type of post I make, I sometimes uncheck the ‘trackback’ checkbox. I found that some blogs have this separation feature already built-in in their themes. Some themes unfortunately lack this. Good tutorial. Thanks

  220. glasgow (1 comments)15 February 10

    helpfull info , i have implemented this on my template on theme forrest

    thanks

  221. I just wonder what is the use of having a track back in a blog.

    Yeah, it is better if there are no disruption in the comments area so that commenter can have a good view of the comments and can contribute well on the discussion.

  222. Thanks for this. I just implemented this on my blog.

  223. thank you ;)

  224. m65 (19 comments)27 February 10

    i dont think any other blog software will be able to come in and beat wordpress

  225. Debjit (2 comments)7 March 10

    Hey! Thanks for this. I have a suggestion to add. Some themes do not have the line ($comments as $comment) in them as they use some other format of the theme core files. Here is how it can be worked around, to get only the trackbacks. The simplest way is to include this:

  226. Debjit (2 comments)7 March 10

    //PHP start
    wp_list_comments(‘type=pings’);
    //PHP End

  227. Yeah, these codes can help me a lot, I have to say, it’s very useful for solving some question.

  228. julian (1 comments)12 March 10

    i have read this, i will try in my blog..
    thanks

  229. sikiş (2 comments)12 March 10

    Thanks for this. I just implemented this on my blog.

Leave a Comment

Your reply will be added to the comment above (Below any other replies to this comment) -

(We DoFollow)

Not sure how to get an image with your comment?