with Lorelle and Brent VanFossen

Separating Comments and Trackbacks and Pingbacks in WordPress – The Answer

I have been struggling with the issue of comments, trackback and pings in my WordPress site. Thanks to Nooscope’s article on Separating Trackbacks & Pingbacks in WordPress 1.5 (1.3), I found the answer.

Let me clarify why I am an issue with comments, trackbacks and pingbacks. First of all, I love them. Adding the interactive comments to our site is something I’ve wanted to do for years. With WordPress, it came built in.

What I don’t like is that the comments are really important, while the trackbacks and pingbacks are nice, complimentary, and ego boosters (yeah, someone linked to me!), they read like comments and get in the way of trying to read through the comments if you are intend on finding more information from within the comments.

I wanted them separated.

Different plugins and techniques have come and go, but WordPress has been changing their core code rapidly, expanding and energizing it. Separating comments from trackbacks and pingbacks have suffered. Luckily, Noscope came up with the answer.

The technique is to copy from the text file Noscope has provided on their site (you may have to hunt on the page for it because it can be hard to find against the overly dark web page design).

You must backup your comments.php or comments-popup.php template file first. If you are using a good text editor, keep that file open in the program.

Create a new text file and paste in the code from the downloaded comments.txt file.

With this alone, if you have not customized your comments template file, whichever one you use, then just save this file as comments.php or comments-popup.php, whichever one you use (people usually only use one of them), and upload it to your site and test it out.

If you have, like me, customized your comments template file, it’s time to go to work.

The first thing on my agenda was to move the Trackbacks and Pingbacks to the bottom of the list, putting the Comments right up at the top. I selected all the code between <? // Begin Trackbacks ?> and <? // End Trackbacks ?> and just moved it below <? // End Comments ?>. Ah, that felt much better.

Then I had to go through each bit of code between my original comments template and the new one and make sure that all of my customization features were changed in the new one. This meant changing the headings from h2 to h4 to match my site’s heading order and design. Also, elminating the double commetmeta information where the date and time of the comment are listed under the name and below the comment. Why have it there twice? I changed a few style things to match, and then copied over the comment form area from my old comment template because that was all customized to feature the Live Comment Preview Plugin.

Go carefully through as the code may be different, but it works. I just changed the styles to clean up the look.

When it was done, I uploaded it, fixed a few more things and uploaded it again, then ran a validation check on my test page with lots of comments, and found a few details that needed cleaning up. Cleaned those up and it was ready to go.

Mucho thanks to Noscope for this great technique and for the rest of you – think of it as comment laundry and go separate your comments from your trackbacks and pings.

Post a Comment

Your email is kept private. Required fields are marked *