How to Create Short Retweet Urls for Your Domain Name

How to create short urls from your own domain name to make it east to retweet? Its easy to link to short urls instead of the long keyword stuffed urls bloggers generate for SEO purposes. We are using these short url redirects and this article is the answer to how we do it on our site.

While there are many short url services you can use like,,, etc., there is nothing better than your own domain name short url which looks better for retweeting and expresses your brand better on Twitter.

short retweet urls

Which do you prefer?

I prefer we get retweeted like this, and this is what our Twitter button does.

short url tweeted

In an attempt to increase our site speed, we removed the Tweetmeme retweet button and its time consuming javascripts, and added a manually coded tweet it button.  But if we linked to our complete url, then there was no space for adding post title and the long url filled up all 140 characters allowed by Twitter.

Usual Twitter Tweet it Links

A normal code posting to Twitter like a text link would look like this

<a href="<?php the_permalink(); ?>">Tweet this</a>

Here is the same code when applied to a twitter image

<a href="<?php the_permalink(); ?>"><img src="/tweet.png"></a>

Retweet with your Own Domain Name Short Urls

The beauty of WordPress is that every single post has a unique Post ID, besides the usual keyword rich long url we all like. So the key is to call this post ID url, which would redirect automatically to your long keyword url since you saved permalinks in such a way.

So basically for every permalink url
<?php the_permalink(); ?>

there is also a Post ID url, so in our case
the_ID(); ?>

1. If you want to link to the short url, then the tweet links look like this

<a href="<?php the_ID(); ?>">Tweet this</a>

2. Now we want this link to open in a new window / tab, so add the target

<a href="<?php the_ID(); ?>" target="_blank">Tweet this</a>

3. Now lets remove the www and make it even shorter

<a href="<?php the_ID(); ?>" target="_blank">Tweet this</a>

4. We can also fit in the post title and RT @qot (our twitter url), so the the final code would look like

<a href="<?php the_ID(); ?>

<?php the_title(); ?> RT @qot" target="_blank">Tweet this</a>

5. We decided to add a tweet this image so our final code would look like this

<a href="<?php the_ID(); ?> <?php the_title(); ?> RT @qot" target="_blank"><img src="/tweet.png" width="96" height="19" border="0" alt="tweet"></a>

Now you can create short urls for your own domain name which are very useful and gives you all the branding you need on Twitter.


  1. Deluxe Blog Tips says:

    Yeah, it’s always better when we provide short links for tweeting. In WordPress 3.0, there’s built-in function that helps us display shortlinks, shortlink(). So, we can start using it without hand-coded for links.

  2. Sagar Gholap says:

    Nice! I didn’t even thought of this. Would definately implement on my blog instead of the numerous scripts which slow down the loading of my blog.

  3. Satya Prakash says:

    It is a nice trick. But you are also using tweetmeme button.
    We like to show tweet count so that is also useful !

  4. Short Url Redirection says:

    With a little creativity you could really make a .info work for you e.g. Short Url Redirection

  5. aif 4 says:

    Here elaborates the matter not only extensively but also detailly .I support the
    write’s unique point.It see for
    is useful and benefit to your daily life.You can go those
    sits to know more relate things.They are strongly recommended by friends.Personally

  6. Aahna says:

    hey can anyone here to tell me how to create a short url website.??? so other users come to our website and do url short for there urls???

    • Satya Prakash says:

      I will say think of strong business plan before thinking of this starting business based on this. As google also has this service and it can open for all also. and lot of other service providers are there in market.

Leave a Reply

Your email address will not be published. Required fields are marked *