Get Your Own Personalized Shortened Links Like Bit.ly with WordPress
Ever wanted your own personalized domain for shortened URLs like bit.ly? Or, for example, the way we use wp.mu here at WPMU DEV?
Well, it’s possible. And perhaps the easiest way to achieve it is to go ahead and run things through Bit.ly, letting them do most of the heavy lifting, but also letting them do some tracking and stat keeping for you too.
Suppose you had a domain name like:
(The .com being taken, of course.)
But let’s also suppose you also had the domain name shor.ty.
(No, the .ty extension doesn’t actually exist.)
Wouldn’t it make sense to shorten your URLs to use the shor.ty domain? That’s what we’ll do in the example below.
Just follow the steps.
Step 1: Sign Up for Bit.ly
Sign up for a Bit.ly account or sign into your existing account.
Step 2: Install Plugin
Install and activate the WP Bitly plugin.
Step 3: Get OAuth Token
Once the plugin is activated, go to the settings page for it. The settings for this plugin happen to be at the bottom of your Writing page settings: Settings > Writing.
You will see the WP Bit.ly Options there. It first asks for an OAuth Token. If you’re signed into Bit.ly, when you click on the link provided under the red box, it should take you to the right page in your Bit.ly account.
You may have to verify your email address if you haven’t done that.
Get your token from Bit.ly, and then go back to your settings and put it in the red box. If everything is all right, the box should turn white when you save the settings.
Below that box, you will also see which types of content you want these short links generated for (posts, pages, etc.). Select what you’d like there.
Step 4: Set Up Short Domain
Assuming you already have a short domain you’d like to use (like shor.ty), go back to your Bit.ly account now and set it up there.
In the top right-hand corner of your account page, you’ll see your login name with a little arrow by it. Clicking on that arrow gives you a drop-down menu. Choose “Settings” from that menu.
Once in the Settings section, click on the “Advanced” tab at the top.
In the Advanced tab you can read Bit.ly’s explanation about setting up your own domain.
Essentially you will need to click “Personal” or “Business.” Clicking “Business” takes you to a sign up page for “Brand Tools.” After a little poking around, it would appear that “Brand Tools” cost $995/month.
Instead of pulling out my credit card, I clicked the free “Personal” option instead. It was a much less difficult decision than you might imagine.
On the next page, you will need to put the domain you will be using as your “short domain” in the box at the top (e.g. shor.ty).
And then a little below that, Bit.ly gives you an IP address to put into the A Record spaces for you domain. (See next section.)
Step 5: Set Up A Record
For this next step, you’ll need to go into your account at your domain registrar and change your A Records for the domain you’re using (e.g. shor.ty), putting in the IP address Bit.ly gives you.
Because different registrars are set up differently, it’s hard to say exactly how you can get to your A Records, but they are a pretty common setting, and so just hunt around a while. You’ll probably first need to click on something that says “manage domain” or something similar first.
You may also need to look under DNS Settings or something similar.
If you can’t find how to get to your A Record settings, then do a search. Again, it’s a pretty common thing, and so your registrar should have instructions for you.
Barring that, of course you can contact your registrar.
Once you find your A Record settings, it’s pretty easy. Just insert the new IP into the @ section and the www section, then save your changes.
Step 6: Verify Your A Record
Next, go back to Bit.ly and verify your A Record settings.
It may take a little while for things to resolve, but that should be it.
Step 7: Get Shortlinks
Now, every time you publish a post and then click the “Get Shortlink” button beside your URL, you’ll see your shortname domain pop up in the shortlink box.
And that’s it. Now you’ll have your own shortened domain for links in places like Twitter, etc. As well, as mentioned, running your domain through Bit.ly gives you the added advantage of tracking those links with their stat service.