{"id":1438,"date":"2008-06-08T12:59:25","date_gmt":"2008-06-08T04:59:25","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/how-to-seperate-comments-and-trackbacks-wordpress-tips\/"},"modified":"2025-04-04T00:40:29","modified_gmt":"2025-04-03T16:40:29","slug":"how-to-seperate-comments-and-trackbacks-wordpress-tips","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/how-to-seperate-comments-and-trackbacks-wordpress-tips\/","title":{"rendered":"How to Separate Comments and Trackbacks [WordPress Tips]"},"content":{"rendered":"<p>Most wordpress themes out there (by default) combine both comments and trackbacks \/ pingbacks together and display under the same list. But why bother separating them? Simply to <strong>make things looks more organize<\/strong> so your blog commenters have a clearer picture what are the comments, what\u2019s not.<\/p>\n<p>Doing it is not hard, but you need toe be using independent WordPress blog (not the wordpress.com), provided with access to change comments.php. Fire up your favorite editor, and here we go.<\/p>\n<p><!--more--><\/p>\n<p>You will be adding and editing you comments.php. So do a backup of that file before you start amending it.<\/p>\n<h2>Step 1<\/h2>\n<p>Look for:<\/p>\n<pre>\r\n&lt;?php foreach ($comments as $comment) : ?&gt;\r\n<\/pre>\n<p>Paste after:<\/p>\n<pre>\r\n&lt;?php $comment_type = get_comment_type(); ?&gt;\r\n&lt;?php if($comment_type == 'comment') { ?&gt;\r\n<\/pre>\n<h2>Step 2<\/h2>\n<p>Look for:<\/p>\n<pre>\r\n&lt;?php endforeach; \/* end for each comment *\/ ?&gt;\r\n<\/pre>\n<p>Paste before:<\/p>\n<pre>\r\n&lt;?php } else { $trackback = true; } \/* End of is_comment statement *\/ ?&gt;\r\n<\/pre>\n<h2>Step 3<\/h2>\n<p>Look for:<\/p>\n<pre>\r\n&lt;?php else : \/\/ this is displayed if there are no comments so far ?&gt;\r\n<\/pre>\n<p>Paste before:<\/p>\n<pre>  \r\n&lt;?php if ($trackback == true) { ?&gt;\r\n  &lt;h3&gt;Trackbacks&lt;\/h3&gt;\r\n  &lt;ol&gt;\r\n  &lt;?php foreach ($comments as $comment) : ?&gt;\r\n  &lt;?php $comment_type = get_comment_type(); ?&gt;\r\n  &lt;?php if($comment_type != 'comment') { ?&gt;\r\n  &lt;li&gt;&lt;?php comment_author_link() ?&gt;&lt;\/li&gt;\r\n  &lt;?php } ?&gt;\r\n  &lt;?php endforeach; ?&gt;\r\n  &lt;\/ol&gt;\r\n&lt;?php } ?&gt;\r\n<\/pre>\n<p>That\u2019s it. Update your blog and you\u2019ll notice Trackbacks have been pulled out from comments and displayed underneath. If you want to display Trackbacks before comments. the easiest way is adding &lt;div&gt; to both and control the style via CSS. Have fun.<\/p>\n<div class=\"ref-block ref-block--post\" id=\"ref-post-1\">\n\t\t\t\t\t<a href=\"https:\/\/www.hongkiat.com\/blog\/40-most-wanted-wordpress-tricks-and-hacks\/\" class=\"ref-block__link\" title=\"Read More: 60+ Most Wanted WordPress Tricks and Hacks (Updated)\" rel=\"bookmark\"><span class=\"screen-reader-text\">60+ Most Wanted WordPress Tricks and Hacks (Updated)<\/span><\/a>\n<div class=\"ref-block__thumbnail img-thumb img-thumb--jumbo\" data-img='{ \"src\" : \"https:\/\/assets.hongkiat.com\/uploads\/thumbs\/250x160\/40-most-wanted-wordpress-tricks-and-hacks.jpg\" }'>\n\t\t\t\t\t\t\t<noscript>\n<style>.no-js #ref-block-post-1474 .ref-block__thumbnail { background-image: url(\"https:\/\/assets.hongkiat.com\/uploads\/thumbs\/250x160\/40-most-wanted-wordpress-tricks-and-hacks.jpg\"); }<\/style>\n<\/noscript>\n\t\t\t\t\t\t<\/div>\n<div class=\"ref-block__summary\">\n<h4 class=\"ref-title\">60+ Most Wanted WordPress Tricks and Hacks (Updated)<\/h4>\n<p class=\"ref-description\">\n\t\t\t\t\t\tHave you ever came across a WordPress blog, saw something you liked, and thought; how they did that,...\t\t\t\t\t\t<span>Read more<\/span><\/p>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Most wordpress themes out there (by default) combine both comments and trackbacks \/ pingbacks together and display under the same list. But why bother separating them? Simply to make things looks more organize so your blog commenters have a clearer picture what are the comments, what\u2019s not. Doing it is not hard, but you need&hellip;<\/p>\n","protected":false},"author":140,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[49],"tags":[4663,252],"topic":[4520],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Separate Comments and Trackbacks [Wordpress Tips] - Hongkiat<\/title>\n<meta name=\"description\" content=\"Most wordpress themes out there (by default) combine both comments and trackbacks \/ pingbacks together and display under the same list. But why bother\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/how-to-seperate-comments-and-trackbacks-wordpress-tips\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Separate Comments and Trackbacks [Wordpress Tips]\" \/>\n<meta property=\"og:description\" content=\"Most wordpress themes out there (by default) combine both comments and trackbacks \/ pingbacks together and display under the same list. But why bother\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/how-to-seperate-comments-and-trackbacks-wordpress-tips\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2008-06-08T04:59:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-03T16:40:29+00:00\" \/>\n<meta name=\"author\" content=\"Alfredo K\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alfredo K\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/how-to-seperate-comments-and-trackbacks-wordpress-tips\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/how-to-seperate-comments-and-trackbacks-wordpress-tips\\\/\"},\"author\":{\"name\":\"Alfredo K\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/b7b5c2018f96391a3d260970e9c202d9\"},\"headline\":\"How to Separate Comments and Trackbacks [WordPress Tips]\",\"datePublished\":\"2008-06-08T04:59:25+00:00\",\"dateModified\":\"2025-04-03T16:40:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/how-to-seperate-comments-and-trackbacks-wordpress-tips\\\/\"},\"wordCount\":176,\"commentCount\":28,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"keywords\":[\"ad-divi\",\"WordPress Tips\"],\"articleSection\":[\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/how-to-seperate-comments-and-trackbacks-wordpress-tips\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/how-to-seperate-comments-and-trackbacks-wordpress-tips\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/how-to-seperate-comments-and-trackbacks-wordpress-tips\\\/\",\"name\":\"How to Separate Comments and Trackbacks [Wordpress Tips] - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"datePublished\":\"2008-06-08T04:59:25+00:00\",\"dateModified\":\"2025-04-03T16:40:29+00:00\",\"description\":\"Most wordpress themes out there (by default) combine both comments and trackbacks \\\/ pingbacks together and display under the same list. But why bother\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/how-to-seperate-comments-and-trackbacks-wordpress-tips\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/how-to-seperate-comments-and-trackbacks-wordpress-tips\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/how-to-seperate-comments-and-trackbacks-wordpress-tips\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Separate Comments and Trackbacks [WordPress Tips]\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/b7b5c2018f96391a3d260970e9c202d9\",\"name\":\"Alfredo K\",\"description\":\"Alfredo is an editor for Hongkiat.com. He believes in working hard and playing hard and hopes to publish his travel guide for food lovers one day.\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/alfredo_k\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Separate Comments and Trackbacks [Wordpress Tips] - Hongkiat","description":"Most wordpress themes out there (by default) combine both comments and trackbacks \/ pingbacks together and display under the same list. But why bother","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/how-to-seperate-comments-and-trackbacks-wordpress-tips\/","og_locale":"en_US","og_type":"article","og_title":"How to Separate Comments and Trackbacks [Wordpress Tips]","og_description":"Most wordpress themes out there (by default) combine both comments and trackbacks \/ pingbacks together and display under the same list. But why bother","og_url":"https:\/\/www.hongkiat.com\/blog\/how-to-seperate-comments-and-trackbacks-wordpress-tips\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2008-06-08T04:59:25+00:00","article_modified_time":"2025-04-03T16:40:29+00:00","author":"Alfredo K","twitter_card":"summary_large_image","twitter_creator":"@hongkiat","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Alfredo K","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/how-to-seperate-comments-and-trackbacks-wordpress-tips\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/how-to-seperate-comments-and-trackbacks-wordpress-tips\/"},"author":{"name":"Alfredo K","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/b7b5c2018f96391a3d260970e9c202d9"},"headline":"How to Separate Comments and Trackbacks [WordPress Tips]","datePublished":"2008-06-08T04:59:25+00:00","dateModified":"2025-04-03T16:40:29+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/how-to-seperate-comments-and-trackbacks-wordpress-tips\/"},"wordCount":176,"commentCount":28,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"keywords":["ad-divi","WordPress Tips"],"articleSection":["WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/how-to-seperate-comments-and-trackbacks-wordpress-tips\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/how-to-seperate-comments-and-trackbacks-wordpress-tips\/","url":"https:\/\/www.hongkiat.com\/blog\/how-to-seperate-comments-and-trackbacks-wordpress-tips\/","name":"How to Separate Comments and Trackbacks [Wordpress Tips] - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"datePublished":"2008-06-08T04:59:25+00:00","dateModified":"2025-04-03T16:40:29+00:00","description":"Most wordpress themes out there (by default) combine both comments and trackbacks \/ pingbacks together and display under the same list. But why bother","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/how-to-seperate-comments-and-trackbacks-wordpress-tips\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/how-to-seperate-comments-and-trackbacks-wordpress-tips\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/how-to-seperate-comments-and-trackbacks-wordpress-tips\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Separate Comments and Trackbacks [WordPress Tips]"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/b7b5c2018f96391a3d260970e9c202d9","name":"Alfredo K","description":"Alfredo is an editor for Hongkiat.com. He believes in working hard and playing hard and hopes to publish his travel guide for food lovers one day.","url":"https:\/\/www.hongkiat.com\/blog\/author\/alfredo_k\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-nc","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/1438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/140"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=1438"}],"version-history":[{"count":3,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/1438\/revisions"}],"predecessor-version":[{"id":73493,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/1438\/revisions\/73493"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=1438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=1438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=1438"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=1438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}