Prevent trackbacks when linking between posts within your WordPress site

I’m a fan of revisiting posts within a blog and linking to related posts. Whether adding cross-references in the body of the text or at the end of a post via a related posts plugin, I think these links can benefit both readers and site owners.

Linking between posts is also essential if you’re writing a series of related posts.

One result of linking posts bothers me though. Trackbacks or pingbacks in the comments section of your own post don’t make sense in the context of your own site. Trackbacks only make sense in the context of other people linking to your post.

So how do trackbacks appear in the first place?

In WordPress, if you’ve enabled trackbacks and pingbacks in your post:

Trackbacks and pingbacks enabled in WordPress

…and you add an absolute link to a second post within your site:

Insert link dialog box in WordPress admin interface

…a trackback appears in the comments list of the second post.

How to prevent trackbacks for posts within your own site

You can prevent trackbacks appearing when linking posts on your own site by using a relative link instead of an absolute link. For example, use the relative link:

/link-to-another-post

…not the absolute link:

http://www.yoursite.com/link-to-another-post

Hat tip to Tim J for the information.

  • For some reason trackbacks won’t even display on my blog (presumably there’s a template tag missing from my heavily customised theme). This used to bother me, but actually I’ve come to realise that I find trackbacks get in the way.

    As you say, they’re generally out of context. Also they tend not to give enough information to glean the context they were written in, you have to leave the current page in order to read them, and often their authors are referring to the original post but not actually commenting on it.

    If I ever get around to figuring why trackbacks won’t display on my blog, I might try bunching them together at the end of the comments. That way they should make sense as a group, and not interfere with the discussion.

  • Thanks for the comment Michael. Have you got the default setting to allow trackbacks for all posts switched on? In WordPress, go to Settings > Discussion and select the checkbox for ‘Allow link notifications from other blogs (pingbacks and trackbacks.)’

    If you get the trackbacks to display on your blog, you may find Michael Martin’s tutorial useful on editing comments.php so that trackbacks are displayed separately from comments. I used it on this blog and think it helps having the trackbacks displayed after the comments list, so that they don’t get in the way.