John Chow dot Com Free WordPress Installation - Start Your Blog Today!
 

How To Create Your Own Tiny URL

written by John Chow on July 12, 2009

Get Traffic To Your Site!

If you have ever clicked my “Tweet This Post!” icon at the bottom of the post, you’ll see that it will take you to Twitter so you can tell all your followers about the great post you’ve just read. Because of the 140 character limit, URLs that are longer than 30 characters are shorten with an URL shortening service like TinyURL or Bit.ly. If you look at the URL I use, you’ll see that it still has johnchow.com in it. I do this to maintain and reinforce my brand. Here’s how to create your own tiny URL for your WordPress blog.

Shortening The Default WordPress URL

We begin by shortening the WordPress URL structure. By default, WordPress names its URL as yourblog.com/?p=xxxx, with the xxxx being the post number. The default URL isn’t very Google friendly and most bloggers will turn on the SEO friendly URL instead. However, the default URL will still work even if you’ve turn on SEO friendly URL. The URL will simply forward to the SEO one.

Because it’s a lot shorter, the default WordPress URL makes a great starting point to create our own custom short URL. The first thing I did was remove the ?p= so the URL becomes johnchow.com/xxxx. You do this by adding the following code to your htaccess file.

RewriteCond %{REQUEST_URI} ^/([0-9]+)$
RewriteRule .* http://www.johnchow.com/?p=%1 [R=301,L]

Change jonchow.com to your domain and you should be good to go. I highly recommend you back up your htaccess file before editing it.

Create The Tweet This Post Link

The following code will create the Tweet This Post link you see at the bottom of my blog articles.

<a rel=”nofollow” href=”http://twitter.com/home/?status=Reading @JohnChow – <?php the_title(); ?> http://johnchow.com/<?php the_ID(); ?>”><img src=”http://www.johnchow.com/images/tweet-this.png” alt=”Tweet This” /> <strong>Tweet This Post!</strong></a>

Insert the above code (change to your domain and twitter name and upload your own bird image and link to that) into your WordPress single.php file at the point where you want the Tweet This link to show up. In my case, I have it appear at the end of the post. If you click the Tweet This Post link, it will send you to Twitter and the following tweet would be insert into your What are you doing? box.

Reading @JohnChow – How To Create Your Own Tiny URL http://johnchow.com/9894

Doing it this way allows me to bypass the use of an URL shortening service. JohnChow.com only has one more letter than TinyURL.com so this isn’t a big deal. What is a big deal is the URL has my blog domain name in it and reinforces my brand. The other advantage is I don’t have to worry about TinyURL or bit.ly going down and messing the URL up. You can save yourself a few letters by using www instead of http:// as Twitter.com will auto link the URL. However, Twitter clients like TweetDeck will not link the URL if it’s missing the http:// so I recommend you stick with that and not brother with the www.

You won’t have to worry about readers seeing the shorten URL after they get to your blog because WordPress will auto forward them to the SEO friendly URL. I added a ref=nofollow tag to ensure that no Google juice is passed to the short URL.

If you like this post, please click the Tweet This Post link and tell all your followers about it. :)

Did you enjoy this post? Get John Chow Dot Com updates via email...

Stay up to date with all of John Chow’s tips for making money online and blog posts by subscribing via email. Your email will be kept private and never shared with anyone.

Comments have been disabled for this post.
Sort: Newest | Oldest

Ever since Twitter popped up, people have been creating shortening sites here and there. There are domain extensions i have NEVER heard of!

-Mike

Free Arcade Games’s last blog post: Perfect Shot

Aha, this is brilliant, I thought. So useful and with excellent instructions that even a luddite like me will be able to follow. But after an hour I have to give up. Sob. I did so well and managed to discover what my post number was (1499 would you believe it even though I've only written about 60 posts), but I simply cannot find my single.php file and when I just paste the code at the bottom of my post if gets corrupted when I save it. Please can you give me a clue about the whereabouts of the .php file I need? Sorry for being so slow!

Thanks, Annabel

Uncanny Blogger’s last blog post: Seven Reasons To Go For a Walk

Some Wordpress Template don't have a single.php file. It maybe call page.php. If you can't find that then look at your index.php.

thanks a lot for that awesome trick

vijju’s last blog post: Excema

really wonderful. as you know johnchow do always wonderful things

vijju’s last blog post: Natural eczema Treatment - Four Drug Free Ideas

Thanks for the tips, i will try at my web..

man...that's an awesome trick..thanks a lot!

gurtey’s last blog post: Tumblr launch

it all sounds so simple, but I made the mistake of making some edits to my htaccess file last month and could not access my site at all after that. I ended up having to do a complete restore from backup. Be very careful with your edits!

That's why you must always back up you htaccess file before doing any editing!

I am sure your web host can do something about that for you!

Ben Pei’s last blog post: Pro Blogging Secrets™ Pre-Launch Notice

So we have seen another aspect of John. From where you have learn this

Will try to use this on my other blogs.

ZK @ Web Marketing Blog’s last blog post: How to make a Six Figure Blogging Income

I think I will be sticking with TweetMe plugin, does all I need!

videostar’s last blog post: Is It Still Worth Using Squidoo?

saw you post this request on twitter last week ... who eventually helped you figure it out?

Someone on my IM list help me worked it out. A fellow tech site owner.

Ok, you actually made it look so easy. However, being not so technical, I am afraid to touch those htaccess files for fear I might cause havoc in my blog. Thus I looked for some plugin and found Blair's pretty link plugin that actually makes it easy and safe to do just the thing, and more.

james moralde’s last blog post: Stephenie Meyer’s New Moon

HeHe I see you've managed to do it then John ;)

As useful as this might be, it is still too much of a hussle.
TinyUrl and Bit.ly are yet to let me down so I'll stick to the TweetMeMe plugin.

Igor

Mastermind Marketing Strategies’s last blog post: How To Make YouTube Videos That Sell

It depends on how much your brand is worth to you. There's a reason my facebook is at located at johnchow.com/facebook :)

I just set it up for my friend's blog, John. Thanks for the guide -- quality content.

It took only a few minutes and it was much easier than I thought it would be.

John how do you learn all this stuff, it take me forever to learn the basics

James Hartje’s last blog post: Stocks on Wall Street Additions: Personal Finance Section

No matter how good you become, you must always be ready to learn and keep learning.

That is a very informative and easy to do thing. Thanks for sharing.

fas’s last blog post: Marketing Your Store On The Internet

Nice One!

But does it work if the custom structure is: /%postname%/? Now I don't know .htaccess that well, but?

Does It?

Tjen Penge Online - Mikkel Juhl’s last blog post: Internet Marketing sjovt? Det kan du bande på!

Yes it does. That is how I have it set up. The short URL forwards to my custom one.

That's a pretty cool idea, although my domain is much longer than Tiny URL to begin with. :p

Chris Jacobson’s last blog post: Sunday Chatter – 7/12

Thanks for the tip, I have not been happy not seeing my url on the tweet.

Thanks John! I totally forgot the default links still work after you change your permalinks to something more SEO friendly. Very useful tip :)

Doug Dillard’s last blog post: Do You Ever Get Distracted While Blogging?

great tips here , i will try as fast as i can

gr8 post.Thanks for the interesting post.

Bradley Nordstrom’s last blog post: STARBUCKS MAKES MY LIFE PERFECT

For those uncomfortable with coding and editing. I guess wordpress has a plugin
short-url-plugin

vaibhav’s last blog post: How to hide all your secret files and folder behind an image?

This is a nice way of of doing it yourself instead of using a service like tweet this. Thanks Greg Ellison

Greg Ellison’s last blog post: Want to start a blog?

See now that is cool and useful information!!! and of course as you planned I tweeted it! LOL:)

Debo Hobo’s last blog post: Money Matters: Get Paid To Travel-Freelance Writing

This is a nice trick. I just bookmarked it. I will try it when I have time. I like it when you preserve your brand. Our branding is very important, and I was searching for that in shortening twitter URL without replacing your own domain name.

Vic- BusinessAccent’s last blog post: What is our greatest asset in life?

If you are using wordpress, then the Pretty Link Plugin does all this and more for your blog url. I highly recommend it.

http://blairwilliams.com/pretty-link/

Nice.. never have to go through all that mess again!

Ben Pei’s last blog post: Are You Getting Enough Links Yourself?

Gets annoying I always have to go to Long Short URL

James Hartje’s last blog post: Stocks on Wall Street Additions: Personal Finance Section

Cool, thanks for sharing

Very good advice. I quite happy to have Twitter post the default url but I know a lot of peole don't like it.

I may post this on ym blog later on. :)

Dean Saliba’s last blog post: 8 Ways To Increase Traffic To Your Blog

Thank you for drawing the reader's attention to this trick,I absolutely share the opinion that it is very easy but no time to put brains into.

game-girl’s last blog post: Фильм City That Sailed с Уиллом Смитом?

Very good tutorial i really hate to put tinyurl domain on my twitter post ,IMO having your own domain name will make the tweet less spammy.

Thanks for this trick!

Mahesh’s last blog post: WebmastersMarketplace.com – A Real Challenger?

Great Tip, I am sure lots of people will be hotli nking to the image URL given in Tweet this post, as you advise only to change the domain name and twitter user name.

actually they also need to upload tweet bird picture on thier site and replace image URL too.

This is very simple but there are people who only do as directed and don't put up their brain into.

Shanker Bakshi’s last blog post: Google Lifted Ban from John Chow dot Com

You certainly have creative mind and you show this on your blog. I think you have also won the prize for suggestions.

ZK @ Web Marketing Blog’s last blog post: Affiliate Theme Coupon Code – Save 15 %

Why didn't I think of this before! I've been creating some manual redirects, but I didn't remember the default WP page thingie. Thank you very, very much for this - I'll be going in and putting this into use right about now :)

Zemalf’s last blog post: In the Spotlight: Zemalf, a Blogger

I was just looking for some Wordpress plugin to tweet a post when I saw the code for to create the Tweet This Post link.

Looks promissing...

Vladan’s last blog post: Like Powershell? There is a Powershell Toolbar

Thanks for the nice tricks. John Chow is really a living legend.. :)

Indeed a helpful post.
johnchow.com always helps you learn something new!

Saurabh’s last blog post: Making The Move: Do you have it in you ?

Awesome trick but I won't be using it. I have the twittley plugin so my posts get voted in twittley and tweet to twitter. :)

Deneil Merritt’s last blog post: Flashback Monday – Wordpress 2.8.1, Resources, & Article Writing Case Study

If I remember, you had posted this before? :-S