Configuring Trackbacks in Drupal

Leaving Tracks

© Axel Teichmann, Fotolia

© Axel Teichmann, Fotolia

Article from Issue 94/2008
Author(s):

Trackbacks offer a simple means for bloggers to connect and share information.

A trackback is a way for a blogger to automatically notify different blogs that he or she has either begun or extended a conversation with another blogger. A trackback is one of three main types of linkbacks (see the "Trackbacks and Linkbacks" box) that bloggers use to keep track of each other's postings and ensure that their readers can link to related content. Once a website has trackbacks enabled, one blogger can reach out to another on a separate site by sending a "ping" to that user. The ping simply says, "Here's a topic that is related to what you've posted, check it out."

If a blogger on a separate site wants to respond, the conversation between the two bloggers becomes stronger. To use the parlance of today's blogging community, the conversation between these two bloggers becomes "context" because now they have been participating in a detailed, relevant conversation. They are building a body of knowledge that will be useful to any reader interested in the topic they are writing about.

With trackbacks, two seemingly unrelated conversations become more strongly associated. Each time an update occurs in the conversation, the context becomes stronger and richer. Search engines often rank pages higher if they are linked from other sites. Trackbacks thus promote higher ratings and perhaps more exposure for a project or product.

Several content management systems (CMSs) include trackback options. In Drupal [1], if you've enabled trackbacks, a blogger on your system just has to enter the URL of a remote blogger who supports trackbacks, and the blogger will be notified. In this article, I describe how to set up trackbacks in Drupal with examples based on the implementation included with Ubuntu 8.04. If you use a different CMS, the configuration will differ but the steps are similar.

Trackbacks and Linkbacks

A trackback is a particular form of a linkback. Three methods of linkback exist:

  • Pingback – A set of protocols that allows you to determine quickly when a remote site has linked to your content or web page. You can also use pingbacks to automatically generate reports.
  • Trackback – Similar to a pingback, but more prone to spamming because connections can be initiated without first establishing a relationship.
  • Refback – An increasingly rare term describing a tracking protocol that allows an author to determine the remote sites and authors who have generated links to them.

You can learn more about linkbacks in all  their forms in various sources, although I recommend beginning at Wikipedia [2], then going to other sources [3] [4].

Getting Started

To enable trackbacks in Drupal, you'll need the TrackBacks module, which is available at the Drupal website [5]. Because so many implementations of Drupal exist, the creators have worked hard to support both 5.x and 6.x versions. As with most modules in Drupal, installation of the module is simple. Simply untar and uncompress the archive inside of the /var/www/drupal/modules/ directory. Again, if you are using a different Linux version, substitute the correct path for your particular distribution.

Once you've unpacked the module, your /var/www/drupal/modules/ directory should have the structure shown in Figure 1. You shouldn't have to restart Apache after installing the module. If you are upgrading from a previous module version, however, you'll have to go Administer | Modules then run the update.php script.

Figure 1: The trackback settings menu.

Once you've installed the module, you'll need to enable it. To do this, go to Administer | Modules, then scroll down through the list of installed modules. Enable the trackback module by selecting the checkbox next to it (Figure 2), then click on the Save configuration button. If you plan on using trackbacks along with blogging, you'll also want to enable the blogging module.

Figure 2: Creating a blogging entry once the trackback module is enabled.

Configuring Trackbacks

The official trackback documentation is rather sparse on the configuration topic [6]. Most of the configuration options are available in the Drupal Administer section. Go to Administer | Settings | Trackback, and you'll find the menu options shown in Figure 3.

Figure 3: A finished blog entry, complete with a trackback URL.

This menu allows you to determine exactly how Drupal will handle trackbacks. Settings include:

  • Auto-detection
  • Moderation
  • Rejecting one-way trackbacks
  • Trackback location

If you enable auto-detection in this particular Drupal module, any URL you post will be checked automatically for a trackback link. It doesn't matter whether you enter the link in a URL or plain text form. The trackback module will check each URL in your document, and it will check to see whether the URL on each page goes to a site that allows and accepts trackbacks. If the remote site does allow trackbacks, the Drupal trackback module will send a ping to the trackback URL found on the remote page.

Auto-detection of every URL can bog down your server, especially if you have quite a few URLs on your page. If you're worried about the volume, use the Run auto-detection on cron option, which delays the URL check until the next time cron is run. If you set cron to run at a time when the server is not busy, it is possible that no one will notice the performance slowdown. The problem with this option is that you won't have trackbacks enabled instantly. It's up to you to configure your cron settings optimally.

Also remember that auto-detection can open your server to spam trackbacks, a trackback that attempts to link your content to unrelated postings. This form of spam is as annoying as traditional email spam.

If you choose to moderate your trackbacks, you will have to manually consider each and every submission. If you're already busy as an administrator, selecting the Moderation setting will make your life even busier. However, it does let you review the suitability of trackbacks and reduce the amount of trackback spam. To review trackbacks, select the Administer | Trackbacks menu option.

Search engines and many bloggers want to see only trackbacks that have been mutually initiated. If you opt to reject one-way trackbacks, then you require mutual trackbacks. Although you might increase the quality of you trackbacks, other bloggers might have a problem initiating contexts and pings.

Trackback location determines where trackback replies will appear in a blogger's post. The default setting positions the trackback URL immediately beneath the post, but you can have these entries posted on a separate page or inline with the text. Most administrators keep the default setting because most people want to see how popular the posting is with other bloggers. If you want to hide trackback replies for whatever reason, select Display on a separate page.

Configuring Content Types

The final configuration task is to determine which content types you want to enable for trackbacks. Trackbacks are enabled by default for all blogs in Drupal, no matter what version you're using. However, they are the only content type enabled by default. The user must explicitly allow trackbacks for other content, such as pages, stories, or other types.

To allow trackbacks for these other content types, go to Administer | Settings | Content types and you will see the various choices. To enable trackbacks for all new pages, click on configure next to the content type, and choose Enabled under Trackbacks.

These trackback settings are not retroactive; if you enable trackbacks for new pages, you will still have to go back and re-publish existing pages to add trackbacks to your previous work. This step will enable trackbacks for any older page, and you'll have to do this for each page individually.

If you want to enable trackbacks for individual entries, you will have to explicitly enable them for each content type by clicking on each URL and enabling the trackback feature.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Drupal

    The PHP-based Drupal framework makes dynamic websites simple. The modular system is extensible using free modules and the appearance is template-driven. In this article, we will be delving into Drupal’s range of functions and discussing installation and basic configuration.

  • Web Tricks

    Busy web developers are always looking for an edge. This month we explore some tricks for faster and more effective websites.

  • Wordpress

    Wordpress is an easy, frugal, and feature-rich tool for creating a personal weblog. If you always wanted your own blog, but you don't have time for the technical details, Wordpress lets you get started in style.

  • WordPress Administration

    Blogs have evolved from private diary to professional tool, and if you manage more than one WordPress installation, administration support would be useful. Three tools can help.

  • Local File Inclusion

    A local file inclusion attack uses files that are already on the target system.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News