YOURLS: Your Own URL Shortener

I have been noticing an interesting trend on Twitter and other social media sites. Larger online publications are starting to set up their own private URL shorteners for their content. Ars Technica has, TechCrunch has, and Oneforty has, for example. Oh, and The Onion has their own short URLs under their domain.

Why are they doing this? To solve two problems that URL shorteners often introduce: The first being that they prevent you from seeing what URL you’re going to land on, which could contain malware of some other undesirable content. Having a private, branded shortener domain adds a level of trust. The second issue is that a few URL shorteners have closed their doors, or announced that they were going to. Handling them internally helps to mitigate that risk, since everything is under the publishers’ control.

How do you set up your own URL shortener? The first step is to get a short domain to use. is a great tool to provide inspiration. Once you have a domain, however, you have to make a decision. Do you want to use something like Pro, or do you want to host everything yourself? If you fall into the latter camp, you may want to give YOURLS a try.

YOURLS, or Your Own URL Shortener, is a PHP script by WordPress plugin developers Lester “Gamerz” Chan and Ozh Richard. It lets you setup a nearly-instant URL shortener. All you have to do is download and configure it on your web server. It even collects statistics.

You can set YOURLS up to be either private or public, and it includes features you would usually expect from a third-party URL shortener, such as:

  • A bookmarklet that you can use to create new short URLs
  • An API that you can use to add YOURLS support to applications like Tweetie 2.
  • Click reports, referrer tracking, visitors’ approximate geo location.
  • The ability to pick custom keywords instead of using sequential URLs.

There’s even a plugin that you can use to integrate YOURLS into WordPress. But if you want an alternative plugin, one that provides more Twitter-oriented features, my Tweetable plugin now supports YOURLS.

I now have my own shortener powered by YOURLS,, which I intend to eventually use across my various websites.

  • Blaine Moore

    I’ve been using YOURLs for a while – it’s a great little piece of software.

    Also – I want to thank you for mentioning the stats. I’m running an older version of the software and didn’t realize they had better tracking in the upgraded version.

    I’m updating it as we speak…

    • Matt

      I hope they implement an update-checking function in a future release. Coming from two WordPress developers, you’d think it would be a fairly obvious function for them to add…

      • Blaine Moore

        That would be a great feature…

  • The Patri0t

    Interesting, shall try out the WordPress plugins on my blogs.

  • John Davis

    I installed it on my site the other day, I had spammers using it within 24-48 hours. I put captcha in place and it has stopped the bad guys. Check it out here live:

    If you have any questions on how to setup captcha on it please feel free to contact me through my site.

    • Blaine Moore

      I don’t have to worry about spammers because I don’t have a public interface for it. If you don’t know the hidden page or have an admin login you can’t use mine. Which is handy.

      • Matt

        That’s how I use it, too.

  • http://bibibhas.cin Bibhas Chandra Debnath

    URL Shortening at your finger tip. :) | Lazy Blogger

  • Jim

    Excellent article! We are linking to this particularly great content on
    our site. Keep up the good writing.

  • Taimoor

    Indeed, very useful and interesting writing. Thank you :D
    I recently wrote about Displaying Advertisements before redirection in Yourls. You should read it. :)
    Thanks! Happy New Year

  • Valarie

    Heya! I realize this is sort of off-topic but I had to ask. Does operating a well-established website such as yours take a lot of work? I am completely new to operating a blog but I do write in my diary daily. I’d like to start a blog so I can share my experience and feelings online. Please let me know if you have any ideas or tips for brand new aspiring bloggers. Thankyou!