PHP / WordPress · March 12, 2007 62

TailHitter: WordPress Plug-in for automatic insertion of HitTail code in all posts & pages of your blog

The HitTail CycleI’ve been using HitTail for a while now and it has helped me quite a bit along the way in optimising my site / content in order to get increased “natural” search hits. For those who didn’t know, HitTail is a free service that reveals in real-time the least utilized, most promising keywords hidden in the Long Tail of your natural search results. It present these terms to you as suggestions that when acted on can boost the natural search results of your site.

HitTail does it’s job through a tracking code that you’ve to implement in your site. One of the problems I faced along the way was that whenever I changed my WordPress theme, I had to insert the HitTail tracking code manually in each theme’s footer. Trust me when I say it can get really tiresome after a while. There was this one occasion (following a theme switch) when my HitTail stats stopped updating altogether. After much deliberation I figured that while I’d reactivated all my other plug-ins, I’d forgotten to insert the tracking code in my new template. If only I had some plug-in doing the same for me automatically every time, it’d be oh-so-convenient. Hence I did some quick research into plug-ins that insert code into WordPress headers & footers and came up with this one.

Current Version

  • 0.4 (Beta)


  • Inserts the HitTail tracking code into all the posts & pages of your blog automatically.
  • Extremely easy to setup – all you need to do is save the tracking code (provided as is by HitTail) in the plug-in options page.
  • Removal of tracking code is as easy as overwriting the saved one with a blank field.



TailHitter  (8.9 KiB, 3,388 downloads)


Once downloaded, simply…

  • Unzip & Copy the plug-in file into your WordPress plug-ins folder.
  • Activate the plug-in from the Plug-in Manager in WordPress.
  • Visit the Options menu and find a new item called TailHitter. Click on that to get to the TailHitter Options page. Once there simply enter your HitTail tracking code and hit Update.

.. and you’re done.

Subversion Repository

Change Log

  • Version 0.4 (2007-03-15)
    • Fixed a major bug that caused the tracking code to be echo-ed out without stripping off the slashes, resulting in invalid JS code that never polled the HitTail service at all. – Thanks to Marcos for pointing it out.
  • Version 0.3 (2007-03-15)
    • Fixed a minor bug that caused incorrect version reporting in WordPress plug-ins management panel.
  • Version 0.2 (2007-03-15)
    • Set the priority of the plug-in to be very low – in effect achieving what HitTail wants, i.e., the HitTail code is now inserted right at the end of the footer. Thanks for George, who runs the G-Loaded (and is an experienced WP Plug-in author) blog for providing valuable advice in this matter.

Please Note

I offer support for my plug-ins via the Chaos Laboratory Support Forum only. I will NOT respond to support queries left in the comment section below and, in most cases, will also not publish them. Of course, if you’d like to say something nice or helpful, then feel free to leave a comment!