How To Create Your Own Tiny URL

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 If you look at the URL I use, you’ll see that it still has 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, 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 You do this by adding the following code to your htaccess file.

RewriteCond %{REQUEST_URI} ^/([0-9]+)$
RewriteRule .* [R=301,L]

Change 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=” @JohnChow – <?php the_title(); ?><?php the_ID(); ?>”><img src=”” 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

Doing it this way allows me to bypass the use of an URL shortening service. only has one more letter than 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 going down and messing the URL up. You can save yourself a few letters by using www instead of http:// as 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. 🙂

61 thoughts on “How To Create Your Own Tiny URL”

  1. Jon says:

    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. Pabz says:

    I dont get it..

  3. Cam Birch says:

    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

  4. Don Campbell says:

    Very cool – thanks John. I like the idea of having your own domain name in the shortened URLs. 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 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

  5. Jon says:

    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

    Jon – Where’s Your Traffic Going?

  6. Philip Nowak says:

    I wish I could do this with my name or blog name. Both or 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

    1. John Chow says:

      As long as the URL is under 30 characters, Twitter will not shorten it.

      1. I usually shorten URL first and than add relevant details so that I do not have to delete again and again.

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

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

    1. John Chow says:

      Yes, this is an update to my tweet this post without the plugin post. I’ve mod the default URL to make it even shorter.

    2. @ Mohnish

      So you are keeping an eye on John Chow and closelt watching him. This is really interesting.

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

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

  9. Saurabh says:

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

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

  10. Thanks for the nice tricks. John Chow is really a living legend.. 🙂

  11. Vladan says:

    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

  12. Zemalf says:

    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

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

    1. 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 %

  14. Mahesh says:

    Thanks for this trick!

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

  15. Joenel Umal says:

    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.

  16. game-girl says:

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

  17. Dean Saliba says:

    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

  18. Cool, thanks for sharing

  19. James Hartje says:

    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

  20. Ben Pei says:

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

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

  21. Dave says:

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

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

  23. Debo Hobo says:

    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

  24. Greg Ellison says:

    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?

  25. vaibhav says:

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

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

  26. gr8 post.Thanks for the interesting post.

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

  27. EarningStep says:

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

  28. Doug Dillard says:

    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?

  29. Garzilla says:

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

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

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

    1. John Chow says:

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

  32. fas says:

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

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

  33. James Hartje says:

    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

    1. John Chow says:

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

  34. KIko says:

    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.

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


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

    1. John Chow says:

      It depends on how much your brand is worth to you. There’s a reason my facebook is at located at 🙂

  36. HeHe I see you’ve managed to do it then John 😉

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

  38. bscene says:

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

    1. John Chow says:

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

  39. videostar says:

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

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

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

  41. EarningStep says:

    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!

    1. John Chow says:

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

    2. Ben Pei says:

      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

  42. gurtey says:

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

    gurtey’s last blog post: Tumblr launch

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

  44. vijju says:

    Your Message

  45. vijju says:

    really wonderful. as you know johnchow do always wonderful things

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

  46. vijju says:

    thanks a lot for that awesome trick

    vijju’s last blog post: Excema

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

    1. John Chow says:

      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.

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


    Free Arcade Games’s last blog post: Perfect Shot

Comments are closed.