Tweaking Twitter Tools to show your URL

I love Twitter Tools. It's one of my favourite plugins for two reasons: it does a whole bunch of different things that I'd expect to need different plugins for, and it always works. But one thing's always slightly bugged me. When it creates a tweet for a new blog post, it sends Twitter the whole, long pretty permalink, and Twitter automatically shortens that to a bit.ly URL.

Frankly, I'd rather have my own URL in people's faces than bit.ly's - so I tweaked one line in the plugin to pass the shorter permalink URL http://domain.com/?p=xx to Twitter. For most domains, this should be short enough that Twitter will leave it intact.

Here's what you need to do. In Plugins > Edit, select Twitter Tools and in twitter-tools.php, find the line$url = apply_filters('tweet_blog_post_url', get_permalink($post_id));

Comment this out (put // at the beginning of the line), and below it, add$url = get_bloginfo('wpurl')."/?p=".$post_id;

This short version of the permalink will automatically redirect to the pretty version (the one with the post title) if you have that enabled.

Share this post:
  • email
  • del.icio.us
  • Facebook
  • FriendFeed
  • LinkedIn
  • StumbleUpon
  • Tumblr
  • Twitter

Tags: , ,

Posted by Sue on August 6, 2009 in Plugins, WordPress.

3 comments to "Tweaking Twitter Tools to show your URL"

  1. det (@elcarpo) wrote:

    thanks!! i'll try it right away!

Leave a Reply