WordPress: How to Separate Pingbacks From Comments

With the popularity of social networking sites, such as Twitter and Facebook, there has been an increase of pingbacks and external comments. Therefore, some bloggers find it easier to separate the two, so it’s easier for their readers and themselves to distinguish between the two. This can be done in two ways: Using a WordPress plugin or manually changing your blog’s code.

What are pingbacks and trackbacks?

Pingbacks and trackbacks are very similar, but other than using different communication technologies (Pingbacks use XML-RPC; Trackbacks use HTTP POST), there are only minor differences. Pingbacks are a way of keeping track of other blogs who have linked to your blog posts within their own blog posts. In order to do this, external blogs have to use your blog post’s hyperlink. Trackbacks work the same, except the blog post’s hyperlink is not placed within an external blog post. They are usually placed in an area specified for trackbacks. Additionally, pingbacks automatically will find the URLs; while trackbacks are done manually.

What are comments?

Comments are responses to a particular blog post that readers have written. Usually, comments are located right after the blog post. People have the ability to reply to one another’s comments directly on the blog without having to go to an external site.

Separating Comments and Pingbacks

If you have noticed, the MakeTechEasier comment system has separated out the pingbacks and the comments for better readability.

wp-comments-pingbacks

So how did we do it?

WordPress Plugins

There are three WordPress plugins that you can use to separate comments from pingbacks/trackbacks:

1. BM-TrackPing

What this plugin does is to strip out the trackbacks from the comment list and then add a single new comment with all the trackbacks in a list at the end. This plugin has not been updated for more than a year, so there is no guarantee that it will work well for the latest version of WordPress.

2. Separate Comments & Pings

This plugin removes pings and trackbacks from comment pages and place them in a new variable $pings. You will have to do further coding to insert the pingbacks separately.

3. Trackping Separator

Remove your pingbacks from the comments and provided you functions (to use in your theme) to list pingbacks/trackbacks separately.

Manually Changing the Code

By far, this is the best (and most effective) way to separate pingbacks/trackbacks from comments. You might get your hands dirty, but I assure you it will be easy. Just follow the instructions below:

Note: The following instructions assume that you are using WP2.7 and above. It will not work for any WP version less than 2.7

In your WordPress theme folder, download the comments.php file from the server.

Open it with a text-editor

Find the following code:

Change the code to be as follows:

What the above code does it to first display all the comments in an ordered list, followed by all the pingbacks/trackbacks in a second ordered list. You can play around with the code to style it up or to change the order of the display.

Once you are done editing, save it.

Rename the comments.php file in the server to comments-old.php and upload this newly edited comments.php to your server theme folder. Now go to your site and see the magic happens.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Shevonne Avatar

Read next

Suzanne Simard sealed paper birch and Douglas fir seedlings inside plastic bags, fed them carbon-14 and carbon-13 dioxide, and nine days later found carbon had crossed between species through fungal threads in the British Columbia soil beneath her boots
A species of jellyfish called Turritopsis dohrnii can revert its adult cells back to a juvenile polyp stage when injured or starving, effectively restarting its life cycle, and biologists have so far failed to identify any natural limit to how many times it can do this.
A Japanese man named Jiroemon Kimura, who lived to 116, was born in 1897 when Queen Victoria still ruled and died in 2013, meaning a single human life personally overlapped with the invention of the airplane, the atomic bomb, the internet, and Instagram
The Hollywood sign originally read HOLLYWOODLAND when it was built in 1923 as a real estate advertisement for a housing development, and it was only meant to stand for 18 months, but nobody ever got around to taking it down and the city eventually adopted it as a landmark
Almost all of the world’s internet traffic does not travel by satellite but through fibre-optic cables lying on the ocean floor, a hidden web of wires crossing the deepest parts of the sea to connect the continents.
People who flip their phone face down on every table aren’t being secretive. They figured out that staying interruptible meant handing their time to whoever rang first
Twitch vs. Facebook Gaming vs. YouTube Gaming: What’s the Best Live Game Streaming Platform?
Chrome Extensions Ownership Transfer is a Direct Threat to You: How to Stay Safe