Bit.ly Links for WordPress, made easy.

WordPress recently added shortlinks for posts to everything, you get a Shortlink button in the backend on published posts, there’s a Shortlink menu in the admin bar etc. But most of us don’t want to use that shortlink. We use Bit.ly, or in my case, Bit.ly Pro and we have no need for that Shortlink menu.

So I decided to do what any WordPress plugin developer does at that point: fix it. I came up with a plugin called Bit.ly Shortlinks. Check it out, and let me know what you think of it :)

A screenshot to get the basic idea:
Bit.ly adminbar item

Tags:


Yoast.com runs on the Genesis Framework

Genesis theme frameworkThe Genesis Framework empowers you to quickly and easily build incredible websites with WordPress. Whether you're a novice or advanced developer, Genesis provides you with the secure and search-engine-optimized foundation that takes WordPress to places you never thought it could go.

Read our Genesis review or get Genesis now!

25 Responses

  1. OttoBy Otto on 5 January, 2011

    Would have been simpler to just use WP Bit.ly, which actually integrates with the built-in Shortlink API, thus making the existing shortlink system just magically show bit.ly shortlinks instead. And thus not requiring a whole new and potentially confusing UI.

    Moral of the story: Don’t reinvent the wheel.

    http://wordpress.org/extend/plugins/wp-bitly/

    • Joost de ValkBy Joost de Valk on 5 January, 2011

      They’re not comparable. Mine is simple and small, that plugin draws stats into the backend, adds admin panels, etc. It does more than my plugin does, and I don’t need or want all that functionality.

      Next to that, my plugin uses WP_HTTP instead of Curl and the same goes for other WP Internals. If you’d actually bothered to look at the code and feature sets of both plugins before judging you’d have seen that.

      • Chip BennettBy Chip Bennett on 5 January, 2011

        Hey Yoast! WP-Bitly is Mark Waterous’ brain-child, but I help him a bit with it (mainly the WP 3.0/Shortlink API integration).

        I don’t see how the two Plugins are “not comparable”. Your description states that the purpose of the Plugin is to “replace[] the shortlink WordPress generates with a proper Bit.ly shortlink”, which is exactly the purpose of WP-Bitly.

        You say that you have no need for “admin panels”, yet the admin options page in WP-Bitly primarily allows the user to enter bit.ly username and API key. You don’t use an admin options page, because your Plugin requires users to hard-code their bit.ly username and API key as constants directly in the Plugin PHP file. Come on, man; that hasn’t been accepted practice since sometime around WordPress 2.5.

        So the only real differences:

        1) WP-Bitly adds a post metabox for displaying clickthrough stats (you may not find it useful, but I imagine that the vast majority of users would find that useful. Nevertheless, we can certainly make it optional.

        2) Your Plugin uses the HTTP API. Sounds like something to look into for improving WP-Bitly

        3) Your Plugin hooks into the WP 3.1 admin bar. Sounds like something else to look into for improving WP-Bitly.

        All that to say: I still think you would have been better off just contributing this to WP-Bitly. I think most users would find far more usefulness with WP-Bitly, and I think that WP-Bitly could be greatly enhanced and improved with contributions such as what you packaged up as a mostly redundant Plugin.

        • Joost de ValkBy Joost de Valk on 5 January, 2011

          Well Chip, I don’t want to offend anyone here, but my plugin is 20 or so lines of code and meant as being a small plugin. I don’t want all the meta boxes and other stuff WP-Bitly adds, I’ve got enough fluff in my backend already.

          That being said: you can easily use the WP HTTP code in my plugin to improve WP-Bitly, and I’d applaud it if you did. If people need or want more from the plugin, I’ll happily point them to WP-Bitly as well. Isn’t that what it’s all about? Having a choice? :)

    • Joost de ValkBy Joost de Valk on 5 January, 2011

      And BTW, there IS no new UI. There’s a new admin bar menu, in the same spot as the Shortlink menu, and for all other purposes, it just reuses the WordPress default UI. Again, look, before you judge.

  2. Gert OomsBy Gert Ooms on 5 January, 2011

    Well this is kind of a cool plugin.

    I’m using currently ‘WordTwit’, to handle url shortning and Twitter stuff. Now in what way will your plugin be able to replace the ‘WordTwit’ plugin. Does it also automatically creates the tweet (I didn’t tested it out yet, but i’m very intersted in the get shortlink replacement) ? I’d rather use your plugin (since Yoast’s plugins have a great value and are proven to be fantastic) than one from someone else.

    • Joost de ValkBy Joost de Valk on 5 January, 2011

      No it doesn’t do anything fancy like that, the link to share on twitter is just a link to twitter’s web UI. It’s clean and simple, because that’s all I needed, there are other plugins that can do more complicated things.

  3. SwamykantBy Swamykant on 5 January, 2011

    Seems to be an awesome Plugin. I currently use bit.ly manually. This is reduce my efforts.

  4. JohnBy John on 5 January, 2011

    Great post – I currently use bit.ly and is.gd, but this looks a lot simpler.

    There’s some great shortners including with the Raven tools package – have you ever come across that Joost? Just trialling it now, would love to know your thoughts.

  5. CormacBy Cormac on 5 January, 2011

    Hi Yoast,
    Interesting plugin. I haven’t downloaded it (yet), but I am wondering if the plugin supports campaign tracking for Google Analytics? That would be nice for measurement junkies, like me!

    Thanks for putting the time in for making something better too.

    • Joost de ValkBy Joost de Valk on 5 January, 2011

      was just adding that feature for myself :D

  6. CormacBy Cormac on 5 January, 2011

    You’re such a tease!

  7. ScottBy Scott on 5 January, 2011

    Cool Plugin Man – Will take a look at this shortly.

  8. EdwinBy Edwin on 5 January, 2011

    Looks cool, but since I have disabled the annoying admin bar it seems I don’t have the option to create shortlinks.

    • Joost de ValkBy Joost de Valk on 5 January, 2011

      You do actually, by going to the edit post screen and clicking the “get Shortlink” button. But the plugin is a lot less useful when you don’t use the admin bar, we’ll agree on that :)

  9. Chip BennettBy Chip Bennett on 5 January, 2011

    Oh, no worries; I’m not so easily offended!

    And I appreciate the offer. I will gladly try to learn from – and implement – what you’ve done with the WP HTTP API.

    Choice is, of course, a good thing – but so is mutual contribution. (I’m no great shakes at PHP; everything I know, little though it may be, I’ve learned from diving into code, and learning from others.) There are a couple thousand WP-Bitly users who would benefit from what you’ve done here.

    • Joost de ValkBy Joost de Valk on 5 January, 2011

      Well see if you can learn it by seeing, if not, ping me and I’m happy to teach you or work with you. It’s just that for my purposes, the plugin was too big and behind the times API wise :) If I had problems with the “competition” I would have removed all the comments mentioning your plugin ;)

  10. Frank EvesBy Frank Eves on 5 January, 2011

    Decades ago, when I was a medical student, I discovered that there was something to learn from everyone. Most doctors had a useful tip worth sharing. Clearly, like the aphorism, “Even a blind squirrel finds an acorn every now and again,” they had bumped into some useful knowledge along the way. In contrast, there was one professor who was pure gold, almost everything he said was a pearl of wisdom worth treasuring. Joost, you are an amazing WordPress professor. Thanks for the bit.ly plugin.

  11. Barbara HolbrookBy Barbara Holbrook on 5 January, 2011

    Can you explain the difference between using Curl vs WP_HTTP? Is it a performance issue? I like the idea of being able to check stats in the back end, but short and sweet is important. I tend to be a plugin junkie, so I’m constantly trying to balance performance and function. ;)

  12. Rob BermanBy Rob Berman on 6 January, 2011

    I was looking for a short cut so that I did not need to go to Bit.ly each time.

    Rob

  13. Todd LahmanBy Todd Lahman on 6 January, 2011

    This plugin would be useful for anyone without their own web server, otherwise http://yourls.org/ would be the first choice, rather than have another URL shortener disappear along with all your shortened links. I personally use YOURLS, and will never again use another URL shortening service.

    For those that need it, this plugin is another good option.

    Hat tip to Yoast for sharing his work. You should do the same Otto.

  14. Dave from The Longest Way HomeBy Dave from The Longest Way Home on 6 January, 2011

    My question here is why the need to manually configure under wp-config.php? Rather than the plugin do it automatically? Just curious.

  15. MarceloBy Marcelo on 6 January, 2011

    Hey Joost! Awesome products you have man! I use your SEO plugin as well as others.

    One doubt: bit.ly is registered in Lybia, and their government has complained about the service, specifically about links to porn content.

    Do you believe that we should worry about all those bitly links being lost if Lybia decides to unregister them?

    Keep the good work man!

  16. Ronen BekermanBy Ronen Bekerman on 6 January, 2011

    Great post – and at a good time, since i did plan on using bit.ly pro!

    One thing though… I have this twitter button in posts + I use you clicky plugin too – both generate separate shortlinks or none at all like the twitter button.

    Any chance all this can be put under control with just one short link method using the bit.ly pro custom url?

    Plus that campaign tracking for Google Analytics thing… since I’m a stats freak as you already know :-)

    Love the new website design by the way!

    Many thanks!

  17. CalebBy Caleb on 7 January, 2011

    yoast, you may want to add some sort of validation to the wp_remote_get function, as it returned an error, and stopped rendering my site. i just added an is_array test (http://csstyle.pastebin.com/hseaa5fz), but you may want to do something more elaborate.