• Home
  • About Mitch
  • Speaking
  • Articles
  • Contact
  • Home
  • About Mitch
  • Speaking
  • Articles
  • Contact

Digital Strategist

WordPress Developer

Content Creator

Unapologetic Punk

Mitch Canter

  • X
  • Bluesky
  • GitHub
  • Twitch
  • YouTube
  • LinkedIn
Tutorial

Creating a Custom URL Shortener using Bit.ly

CMDR Mitchcraft

Reading time: 2 minutes

If you’ve come to this site by way of Twitter or Facebook, you may have noticed that the short link for all of these posts isn’t your typical URL.  I recently purchased snv.me to shorten all of the links to my blog posts and site, and (after some extensive research) found a way to hook it into my site using bit.ly’s pro service (now open to everyone!)

Find a Domain

You’d think this would be the easy part, but you may be mistaken.  Finding a good top-level domain (TLD) that  matches your current site may or may not be difficult, but it depends on where you’re willing to look.  Namecheap has the following extensions: ws, ca, org.uk, in, cc, de, bz, tv, eu, nu, me, us, and co.  All of these two letter domains work fantastic for shortened URLs.  I chose SNV.ME because it has a nice ring, but you may find something that fits your taste.

If you’re looking for something more exotic, domai.nr can look outside of the US/EU to find TLD’s that may work.  Keep in mind some of them may have additional costs and/or restrictions.

Bit.ly

At one point, Bit.ly charged for their pro service. Now, anyone can take advantage of the power of the bit.ly URL shortener with whatever domain you want – and it’s a fairly easy set-up process.

  1. Create an account / log in to bit.ly
  2. Click on “Settings” under the drop-down
  3. Under the Advanced tab’s “Custom Short Domain” click on the “Add a Custom Short Domain” link
  4. The system will give you instructions on how to add bit.ly’s IP address to your domain.
  5. Log in to your domain registrar and click on your DNS settings (this will differ depending on who you’ve registered with).
  6. Add an A record for the IP address with your short domain.

Inside WordPress

Once that’s done, you can install the Bit.ly Shortlinks plugin.  This will allow you to manage everything automatically through WordPress.  However, there is a small bit of core-file editing to do (nothing major).  Edit your wp-config.php and paste in the following code:

/**
 * Settings for Bit.ly Shortlinks Plugin
 * http://yoast.com/wordpress/bitly-shortlinks/
 **/
define('BITLY_USERNAME', 'BIT.LY-USERNAME');
define('BITLY_APIKEY', 'API-KEY');

Your API key can be gotten by heading back to bit.ly and clicking on the settings tab – it’ll be midway down the page.

Now, when you create a new post, you can click the “get shortlink” button and Voila!  You can access your new shortlink and paste it wherever you wish.

bit.ly, namecheap, short url, url shortener
  • Two Recently Updated Plugins YOU Should Be Using

    Two Recently Updated Plugins YOU Should Be Using

    Reading time: 1 minute

    Every now and then, just because I’m the biggest WordPress dork I know, I like to just peruse the plugin database to see what’s been updated recently.  After all, how can you use new plugins if you don’t know they’re there?  I’m glad I looked when I did – I found a few plugins that…

    WordPress
  • Redirection: An Easy Way to Handle 301 Redirects

    Redirection: An Easy Way to Handle 301 Redirects

    Reading time: 3 minutes

    Since I’ve switched to my new design, I’ve also done quite a bit of cleanup work on the content side of things.  I pruned a lot of old articles that weren’t bringing in search traffic (and weren’t related to the site anymore), cleaned up a lot of the categories, and set my permalink structure to…

    Tutorial, WordPress