Dougal Campbell's geek ramblings

WordPress, web development, and world domination.

Trackback vs MetaWeblog API

When I implemented Trackback support here, one snag I ran up against is that I typically post to my website via the MetaWeblog API (using the very cool w.Bloggar client app), and the blog posting APIs don’t provide any inherent way to provide Trackback URLs. Nor should they, as that doesn’t really fall under the API’s core functionality. However, it still seemed wasteful to have to set up a separate web form just for doing Trackbacks. So here’s what I did….

In the server code that handles the client APIs for my blogging software, I added a snippet of code just after where a new entry is actually posted into my blog. The code snippet searches the incoming blog entry for an HTML comment that looks like:


<!-- trackback url=http://www.example.com/tb.cgi/987 -->

If it sees comment like that, the code extracts the Trackback URL and posts a Trackback ping to it. Voila! A tiny amount of work, and now I can go back to being moderately lazy. All I have to do is remember to put the Trackback URL in an appropriately formatted comment, and my server will automagically let the site know that I’ve linked to them.

I’d like to encourage anyone else involved in coding other blogging systems to do the same, if your software supports one of the blogging APIs (BloggerAPI, MetaWeblog API, etc) and Trackbacks.

About Dougal Campbell

Dougal is a web developer, and a "Developer Emeritus" for the WordPress platform. When he's not coding PHP, Perl, CSS, JavaScript, or whatnot, he spends time with his wife, three children, a dog, and a cat in their Atlanta area home.
This entry was posted in Uncategorized and tagged . Bookmark the permalink.

11 Responses to Trackback vs MetaWeblog API

  1. Pingback: Pizza Review

Leave a Reply