Skip to content

Twitter Tools and Custom Shortened URLs

Last updated on February 12, 2017

I’ve been using Alex King’s Twitter Tools for sometime now on some other Wordpress sites I’ve developed. It’s clean, simple and just plain works. However, one thing that’s never really thrilled me about twitter is its use of bit.ly or any of the other automatic URL shortening. Mr. King provides a bit.ly plugin that lets you use your own bit.ly API, so you can tract traffic though your link, but that’s only a minor improovment.

The best solution, in my opinion is to use a custom short URL that’s provided though your own domain. This has several advantages, the biggest for me is that it makes it clear where the link is actually going. However, short canonical URLs are also being touted as a way to avoid massive internet link-rot created by the myrid of URLs services like bit.ly and tinyurl can produce. In fact I’m rather opposed to those services (even if I do use them) for security and clarity reasons. You can read more about rev=”canonical” urls here and here.

Fortunately, running a custom URL shortening service on your own blog isn’t difficult. In fact there’s already a Wordpress plug-in that handles both the shortening and redirection.

All that’s left for my purposes is tying that shortened canonical URL into Twitter Tools so that my tweets don’t get bit.ly or tinyurl links.

What You’ll Need

  1. Rev Canonical – this provides an SEO and URL shortening mechanism
  2. Twitter Tools – to get the updates on twitter.
  3. My TwitterTools RevCanonical URL shortening plug-in – ties it all togeather

RevCanonical Setup

For our purposes all we need to do with RevCanonical is install and activate it. Unless you have another shorter domain you want to do your redirection though (i.e. cot.net instead of cult-of-tech.net) you can leave it at the default settings. Otherwise add your shorter domain to the Custom Shortened Domain Name field in RevCanonical.

Twitter Tools Setup

Twitter Tools is one of the better Twitter plug-ins for Wordpress that I’ve found, though I don’t use all of its functionality. However, it does provide a lot of flexible ways to push and pull data from Twitter. It also provides a series of hooks that makes patching it’s behavior pretty straight forward.

More importantly it requires no setup outside of the basic configuration for this to work.

Canonical Short URLs for Twitter Tools Setup

All that’s left is to download and install my twitter-tools-rev-cannonical plug-in.

Make sure that you don’t also have Twitter Tool’s Bit.ly plug-in activated as well. The two of them won’t necessaraly play well togeather (either it wont work at all or our own canonical urls will be replaced by bit.ly ones).

Once this is installed and activated, you’re good to go.

From now on you’re tweets will use your shortened canonical URL instead of whatever twitter decides to use. Of course there’s still the possibility that due to a long title twitter will shorten your URL further, however I’ve never actually seen that happen since I started using this method almost a year ago.

Published inProgrammingWordpress

One Comment

Comments are closed.