No Visitors on Your Blog? Get Tons of Traffic Today!
 

How To Create Your Own Tiny URL

written by John Chow on July 12th, 2009

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. :)

Tweet This Tweet This Post!
English flagItalian flagKorean flagChinese (Simplified) flagChinese (Traditional) flagPortuguese flagGerman flagFrench flagSpanish flagJapanese flagArabic flagRussian flagGreek flagDutch flagBulgarian flagCzech flagCroat flagDanish flagFinnish flagHindi flagPolish flagRumanian flagSwedish flagNorwegian flagCatalan flagFilipino flagHebrew flagIndonesian flagLatvian flagLithuanian flagSerbian flagSlovak flagSlovenian flagUkrainian flagVietnamese flag
By N2H
  1. Jon

    Definitely useful. Although I never really paid much attention to what the URLs actually say on Twitter, I can see where it would be helpful in not only keeping you from having to manually do the shortening but also in keeping up the “brand name.” Simple instructions, easy to follow.

    Thanks for the tip :)

    Jon’s last blog post: First Prize From Points2Shop

  2. I had noticed that most Tweet This post items were usually a link to some twitter service like TwitThis or TweetMeMe. This is a much better option since it goes direct to Twitter and it avoids the potential of having your account accidently hijacked because of a crappy or unsecure twittering service.

    Cam Birch’s last blog post: Computer Frustrations

  3. Very cool – thanks John. I like the idea of having your own domain name in the shortened URLs.

    Su.pr is supposed to allow you do this (use your own domain name in the short URL) but I haven’t got it to work yet on my Expand2Web domain. The nice thing about su.pr would be the reporting it gives you and the exposure to StumbleUpon.

    Anyway, now I can try the method you’ve outlined here. Thanks!

    Don Campbell’s last blog post: Add a Map to Your Website With Google Web Elements

  4. Jon

    Easier than going the route of creating your own system which is what I did to manage my own properties across the net before opening it up to others. This is what I did to get the in-depth statistics I wanted for sources and referrals with Buzvia.com.

    Jon
    http://Buzvia.com – Where’s Your Traffic Going?

  5. I wish I could do this with my name or blog name. Both philipnowak.com or socialmediaunraveled.com contains way too many characters. For others, this is a great way of reinforcing your brand throughout the entire web.

    Philip Nowak’s last blog post: How to Lose 10,000 Twitter Followers in 1 Day

  6. 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

  7. 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 ?

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

  9. 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

  10. 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

  11. 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

  12. 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.

  13. 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 с Уиллом Смитом?

  14. 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

  15. 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

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

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

  17. 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/

  18. 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?

  19. 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

  20. 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?

  21. 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?

  22. gr8 post.Thanks for the interesting post.

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

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

  24. 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?

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

  26. 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

  27. 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å!

  28. fas

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

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

  29. 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

  30. 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.

  31. 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

  32. 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

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

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

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

  35. 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

  36. 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!

  37. man…that’s an awesome trick..thanks a lot!

    gurtey’s last blog post: Tumblr launch

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

  39. really wonderful. as you know johnchow do always wonderful things

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

  40. thanks a lot for that awesome trick

    vijju’s last blog post: Excema

  41. 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

  42. 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

Trackbacks

  1. Use o próprio WordPress como encurtador de URLs para Twitter » Winnext - July 16, 2009 at 11:20 am