Web & Social
Now Reading
How To Create Your Own Custom URL Shortener For Free

How To Create Your Own Custom URL Shortener For Free

by Brad MerrillJuly 16, 2015

short_urlIn the age of social media, link shortening services have become ubiquitous. But many brands have grown tired of sharing the same old Bit.ly and TinyURL links, instead opting to use their own branded shortlinks.

Branded shortlinks not only take up less space—they also look neater and more professional.

Bit.ly and other platforms offer this as a service, but they typically charge a pretty penny to do so. In this post, we’ll take a look at how you can start operating your own branded URL shortener absolutely free.

Ready? Let’s dive in.

Get A Short Domain

urlThe first step to setting up a custom URL shortener, of course, is to get your hands on a short domain name.

Remember: it needs to be short, or it defeats the purpose—but it should also reflect your brand. Check out these examples:

  • VentureBreak uses vbreak.co
  • The New York Times uses nyti.ms
  • TechCrunch uses tcrn.ch
  • The Next Web uses tnw.to

If you get stuck, I highly recommend using Domainr to help you find the perfect domain hack.

Install Your Own URL Shortener (YOURLS)

yourls_screenshotOnce you’ve got yourself a nice, short domain name, you’ll want to install YOURLS (Your Own URL Shortener). It’s a nifty set of PHP scripts that do everything you want your URL shortener to do. Just follow these steps:

  1. Download and unzip the YOURLS installation package here.
  2. Copy user/config-sample.php to user/config.php.
  3. Open user/config.php in a text editor and fill in the required information.
  4. Upload the files to the root folder of your new domain.
  5. Create a new database, making sure to match the credentials you added to user/config.php.
  6. At this point, you should be able to see the admin panel at yourdomain.com/admin.

Note: some web hosts offer a one-click install option for YOURLS, so you may want to use that method instead.

Congrats! You’ve installed YOURLS on your server, and your URL shortener is ready to go.

Using Your URL Shortener

yourls-logo (1)

So, you’ve got your shiny new URL shortener up and running—but what can you do with it?

Of course you can generate short links manually at yourdomain.com/admin at any time, but YOURLS can do a lot more.

Using The API

If you’re savvy and so-inclined, you can utilize the YOURLS API to automate some off-site tasks. Check out the documentation here, and grab your unique token from yourdomain.com/admin/tools.php.

WordPress Integration

screenshot-1

If you’re publishing with WordPress, you may want to give the Better YOURLS plugin a try. It automatically generates a shortlink for each new published post, and it replaces the default wp_shortlink shortlinks with YOURLS links, making it easy to use them on your site.

A number of social sharing plugins also offer built-in support for YOURLS. If you’re using a plugin that supports wp_shortlink but not YOURLS, you can solve that problem with the Better YOURLS plugin as well.

YOURLS Bookmarklets

yourls_bookmarklets

YOURLS offers some handy bookmarklets that make it easy to generate shortlinks and share them. Head over to yourdomain.com/admin/tools.php and drag them to your toolbar—then just click them when you need them.

If you have any questions, problems, or suggestions, feel free to share them in the comments below!

About The Author
Brad Merrill
Brad Merrill is the founder and former editor of VentureBreak.
  • is it possible to track each Link you post, for example the ROI of each advertisement you are posting through the short links….Please suggest..

    • Yep – the YOURLS dashboard provides stats for all of your links, so you can see how many times each one is clicked.

  • Thanks Brad, I will give it a try, now ,,,

  • one more quick question…..can you shorten URLs in Bulk?

    • I believe there’s a YOURLS plugin that can take care of that for you, yes.