Skip to content
  • Home
  • About Mitch
  • Speaking
  • Articles
  • Contact
  • Home
  • About Mitch
  • Speaking
  • Articles
  • Contact

Digital Strategist

WordPress Developer

Content Creator

Unapologetic Punk

Mitch Canter

  • Threads
  • Instagram
  • Bluesky
  • LinkedIn
  • GitHub
  • Twitch
  • YouTube
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
  • Favorite Plugins–Yours, Mine, and Everyone’s

    Favorite Plugins–Yours, Mine, and Everyone’s

    Reading time: 1 minute

    OK – so I’ve tallied up the results from Tuesday and came up with some really interesting results.  So, I’m going to do something a little fun.  Here are your favorite plugins as determined by the comments, my favorite plugins, and the top 5 plugins from the WordPress repository; let’s see how they match up…

    WordPress
  • State of the Word 2023 Recap

    State of the Word 2023 Recap

    Reading time: 2 minutes

    The WordPress community was abuzz with excitement as Matt Mullenweg, WordPress’ illustrious co-founder, took to the international stage to deliver the first non-North-American “State of the Word”, live from Spain. While there was some retrospection, the theme of the event was definitively looking forward as Matt (and Matias ventura, WordPress’ lead architect) teased new features…

    WordPress