I like running Disqus for comments. It is responsive, it handles spam well, and its uptime has been solid. The one thing it does not do is display trackbacks and pingbacks, and I do like to show who is discussing a post elsewhere on the web. This note is how I bridge that gap without giving up Disqus.

The Trackbacks Are Still There

The good news is that nothing is lost. Even though the Disqus embed ignores them, incoming trackbacks are still recorded in your database exactly as before. In WordPress they live in the same wp_comments table as ordinary comments, distinguished by a comment_type of either trackback or pingback. For display purposes the two are interchangeable; if you are curious about the underlying distinction, this reference page explains it well. Because the data is sitting right there, all you need is a way to pull it out and render it.

Fetching Just the Trackbacks

There is no built-in call that returns only trackbacks, so you write a small helper. The idea is to query for approved entries whose type is trackback or pingback, scoped to the current post:

function get_approved_trackbacks($post_id) {
    global $wpdb;
    $sql = $wpdb->prepare(
        "SELECT * FROM $wpdb->comments
         WHERE comment_post_ID = %d
           AND comment_approved = '1'
           AND comment_type IN ('trackback', 'pingback')
         ORDER BY comment_date ASC",
        $post_id
    );
    return $wpdb->get_results($sql);
}

That returns an array of comment objects. From there, rendering is your choice.

Rendering and Placement

I keep the markup in its own template file so I can style it independently and, in my case, leave out the text snippet that trackbacks usually carry — that is purely personal preference, and dropping it also avoids echoing spammy excerpts. The template walks the $trackbacks array and prints a simple unordered list under a “Trackbacks” heading, each item linking to the source.

To make it appear, open your theme’s single.php and find the line that renders comments:

<?php comments_template(); ?>

Add your trackbacks call on the line above it so the peer discussions show before the Disqus thread:

<?php trackbacks_template(); ?>
<?php comments_template(); ?>

If a trackbacks.php file exists in your theme folder, the code uses it to render the list, which is how I control the styling and suppress the snippet. Without it, you get a sensible default.

Worth the Small Effort

This is admittedly an advanced touch, and only worth doing if you are comfortable with a little PHP. But the payoff is a page that keeps everything I like about Disqus and still gives credit to the people linking in from their own sites. If Disqus eventually adds native trackback support, I will happily retire the helper — until then, this keeps both halves of the conversation visible.