Separating Trackbacks from Comments
594
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?
Enjoy this post? You should follow me on Twitter!


Comments discussion on "Separating Trackbacks from Comments"
Pingback: Pro Blog Design in 2007 and Beyond | Pro Blog Design
Pingback: 10 WordPress Tips & Tricks for Your Comment Page | Lists | Tutorial Blog
Pingback: 10 WordPress Tips & Tricks for Your Comment Page - Blog MasterKom Net
Pingback: Design Review: Yamidoo Magazine « Internet Turnkey Websites
Pingback: i P r o n e t S t u d i o » بیش از 50 مرجع برای یادگیری و استفاده بهتر از وردپرس
Pingback: 10 WordPress Tips & Tricks for Your Comment Page | New Techs
Pingback: 10 WordPress Tips & Tricks for Your Comment Page | Free Tutorial 4 All
Pingback: Wordpress kaliteli yorum sayfası ipuçları « Geldebulma
Pingback: 14 amazing design resources websites
Pingback: Top 10 Tutorials for Working with WordPress Comments
Pingback: 22 Mixed Quality Wordpress Hacks | KolayOnline
Pingback: WordPress Separate Trackbacks and Comments | Pro Blog Design
Pingback: WordPress Commenting: Separate trackbacks | Le studio de design - Do you design ?
Pingback: 10 WordPress Tips & Tricks for Your Comment Page | OpenABlog
Pingback: بیش از ۵۰ مرجع برای یادگیری و استفاده بهتر از وردپرس
Pingback: Usando trackbacks | DRENARE ESTÉTICA TOTAL
Pingback: Top 10 Best Wordpress Tweaking Tutorials | Wordpress seems so easy!
Pingback: Wordpress: Tutorials and Resources for Designers and Developers
Pingback: Kommentare von Trackbacks in Wordpress trennen | GUTES TUN
Pingback: Top 10 Best Wordpress Tweaking Tutorials | Huzzer Magazine
Pingback: 30个增强Wordpress留言部份的技巧 | 帕兰映像
Pingback: 精通Wordpress系列教程- 1: 精通Wordpress主题Hacks与技巧 | 帕兰映像
Pingback: Recursos para la Creación de un Theme WordPress | Area Photoshop
Pingback: Ways to Improve Your Blog – Functionality | Build A Better Blog
Pingback: Wordpress: Seperate your Trackbacks and Comments | WebhostingForce.com
Pingback: US Want - Your Blogs, Social Network, Search Engine for Drivers, UserGuide, Vids, Images, Tutorials
Pingback: 9 Things You Can’t Forget When Designing a Blog | Tutorial9
Pingback: 9 Things You Can’t Forget When Designing a Blog | Tutorial9
Pingback: 9 Things You Can’t Forget When Designing a Blog - Barker Design | Graphic & Web Development
Pingback: Tudo sobre wordpress
Pingback: 9 Things You Can’t Forget When Designing a Blog « Tudo sobre wordpress
Pingback: Wordpress评论(留言)的30个技巧 | WordPress:最流行的开源博客程序
Pingback: بیش از 50 مرجع برای یادگیری و استفاده بهتر از وردپرس
Pingback: Webbrelaterat » Blog Archive » 12 sever
Pingback: Geek Week - This week jQuery tutorials, CSS3, & WordPress - PHP, XHTML, Web Design, Flash | JasonCypret.com
Pingback: Are you getting trackback spam on your Wordpress blog? - BLOGTECHNIKA
Pingback: Design Review: Yamidoo Magazine | Pro Blog Design
Pingback: 100+ Massive Wordpress Tutorial Collection | tripwire magazine
Pingback: Comment Design: Considerations, Best Practices and Examples | Inspiration
Pingback: Comment Design: Considerations, Best Practices and Examples | Lunch Time Laugh
Pingback: Comment Design: Considerations, Best Practices and Examples | Mac Bargains
Pingback: Table Of Contents Of Wordpress Tutorials, Helps, Tips and Tricks | DevWebPro
Pingback: Useful WordPress Resources | Bui4Ever | Bui4Ever.com
Pingback: Mandatory New Year’s Blog Post | Not A Pro Blog with Jordan Cooper | Search Engine Optimization
Pingback: (摘)精通Wordpress系列教程一 « 李小西的博客
Pingback: 14 Tips voor Blog Comment Design
Pingback: wordpress主题的制作和使用技巧 | 一起走过的日子
Pingback: 5 Wordpress PHP Code Snippets | Pingable :: Everything Wordpress
Pingback: Pattern Inc » Comment Design: Considerations, Best Practices and Examples
Pingback: Украшаем комментарии в Wordpress | Рецепты от Сеогада
Pingback: Wordpress: Как разделить комментарии и трекбэки? « Alex Ilin
Pingback: Tutorial : Separating Trackbacks From Comments in Wordpress 2.7, 2.8 & 2.9 | DynamicWP
Pingback: Tutorial : Separating Trackbacks From Comments in Wordpress 2.7, 2.8 & 2.9 | Pc-aras
Pingback: Blog Comment Tools | Blog Tech Guy
Pingback: 如何将引用和留言分开
Pingback: 30 Most Wanted WordPress Comments Page Hacks | Tutorials | instantShift
Pingback: Advanced Wordpress Comment Styles and Tricks | Pro Blog Design
Pingback: Wordpress Hacks « reeboot strategy
Pingback: Wordpress Hacks And Customizations « MoeMir
Pingback: Wordpress Hacks e Customizations! | sinergie.::.websolution | il blog
Pingback: WeDuggIt » Advanced Wordpress Comment Styles and Tricks
Pingback: Wordpress Kullanım ve geliştirme kaynakları | web tasarım ve magazin
Pingback: Wordpress Kullanım ve geliştirme kaynakları | SohbeTCix.NeT | Chat Sohbet Muhabbet Odaları
Pingback: 45+ Wordpress plugins To Enhance Your Comments
Pingback: AddaZ | Blog | Advanced Wordpress Comment Styles and Tricks
Pingback: 30 Wordpress Yorum Sayfası Düzenlemesi | Sorbize
Pingback: sinergie.::.websolution » Blog Archive » Wordpress Hacks e Customizations!
Pingback: 14 Tips voor Blog Comment Design | SENTEL.NL
Pingback: 60+ Awesome WordPress Tutorials | The Best WP Themes Online
Pingback: مصادر لتطوير أدوات الووردبريس (الجزء الأول)
Pingback: Comment Design: Considerations, Best Practices and Examples | WordPress Identity
Pingback: 精通Wordpress主题Hacks与技巧
Pingback: 9 Things You Can’t Forget When Designing a Blog « Phạm Ngọc Sông – Blog
Pingback: WordPress Problem and Solution: Trackbacks Aren’t Working | Gryphon Mountain Journals
Pingback: 50 Usefull Wordpress Hacks & Code Snippets | Tutorial Mag
Pingback: 精通Wordpress系列教程一: 精通你的Wordpress主题Hacks和技巧 - Hyperblue's Blog - PHP+MYSQL|网站开发|插件开发|typo3|WordPress|magento|opencart|dedecms|discuz!
Pingback: HOWTO: Separare commenti e trackbacks in Wordpress | Flavio's blog
Pingback: 35+ Most Essential WordPress Tricks and Hacks | Ngôi nhà trên thảo nguyên!
Pingback: 22 Handy WordPress Code Snippets
Pingback: WordPress Kullanım ve geliştirme kaynakları | web tasarım ve internet magazin
Pingback: WordPress & Adsense Money Blogging » What are Trackbacks and why use them
Pingback: 精通Wordpress教程: 精通Wordpress主题Hacks与技巧
Pingback: 60 Most Wanted WordPress Hacks | stylishwebdesigner
Pingback: My first post « falling4faith
Pingback: Best Way to Have Quality Comments Only? | Pro Blog Design
Pingback: Best WordPress Hacks of All Time - WordPress Advice of the Month
Pingback: Best Way to Have Quality Comments Only? | WordPress Crunch
Pingback: complex 41