• 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
  • Yes, Another WordPress Update.  So?

    Yes, Another WordPress Update. So?

    Reading time: 1 minute

    WordPress released their press release about WordPress 3.0.4.  As soon as it did, I saw the WordPress hashtag on twitter light up – people complaining about having yet another security update.  I hate to get on a soapbox about this, but seriously – you’re going to complain about people working to make your site as…

    WordPress
  • Tuesday Conversations: Your Favorite Plugins

    Tuesday Conversations: Your Favorite Plugins

    Reading time: 1 minute

    My old site was all about me writing stuff.  Don’t get me wrong, I love writing, but I know that I’m not the only guy out there doing this – I love learning from other people about things that I’d never known about otherwise.  Unfortunately, StumbleUpon is devoid of good WordPress articles (lots of theme…

    WordPress