• 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
  • WP-Migrate-DB: Migrating a WordPress Installation in 5 Easy Steps

    WP-Migrate-DB: Migrating a WordPress Installation in 5 Easy Steps

    Reading time: 3 minutes

    If you’re a WordPress developer, migrating a finished development project can be one of the trickiest parts.  There’s moving parts in many places that have to be taken into consideration, and migration is (unfortunately) where WordPress actually could use some improvement.  However, it’s a necessary evil – one that I’ve done almost daily for a…

    WordPress
  • 3+ Things Every Content Creator Needs In 2020

    3+ Things Every Content Creator Needs In 2020

    Reading time: 3 minutes

    There is no better time to stake your claim online. The Internet, one thought to be a ‘passing fad‘, is still here and going stronger than ever. But it’s not enough to just put your voice out on every social media platform you come across. In order to truly succeed online, there are certain necessities…

    Digital Strategy, WordPress