What is Bitly:
It is an online service that provides you short URLs of your posts so that you can share them with your friends, family, and on the web. This service is fairly popular on microblogging site twitter because it is the default shortening service since May 6, 2009. The shorten links created with this service are permanent and somewhat look like this http://bit.ly/6wgJO.How to Auto Generate Short URLs of Your Posts in Blogger with Bit.ly
The First thing you will be doing is to login into your Blogger Dashboard. Now After logging in, go to your blog >> Template >> Edit HTML >> and search for the ]]></b:skin> tag. Once you find it, just above it paste the following CSS code.#shorturl {
float: left;
background: #F8F8F8;
padding-bottom: 10px;
border-top: 1px solid #d2d2d2;
border-bottom: 1px solid #d2d2d2;
padding-top: 10px;
width: 650px;
}
#shorternh2 {
float: left;
padding-left: 20px;
padding-right: 10px;
}
.textinpo {
float: left;
font-family: "verdana",helvetica,Tahoma,Arial,sans-serif;
font-size: 12px;
color: #666;
border: 1px solid #ccc;
border-radius: 3px;
background: #fff;
width: 215px;
padding: 0px!important;
padding-left: 10px!important;
height: 20px!important;
margin: -4px!important;
}
Now after pasting the style sheet coding into your template, it is time to move ahead, and get things a bit more serious. Again in the template, search for <div class='post-footer'> and just above it paste the following JavaScript coding which would generate the shorten URLs and display them at the end of your posts.
<!-- Short URLs Script by MBL -->
<b:if cond='data:blog.pageType == "item"'>
<div id='shoternUrl'>
<form id='shorturl'/>
<!-- short url widget script start -->
<script charset='utf-8' src='http://bit.ly/javascript-api.js?version=latest&login=unbfacts&apiKey=R_cb436480530becb8bb6e628aa34520f2' type='text/javascript'/>
<script charset='utf-8' type='text/javascript'>
BitlyClient.addPageLoadEvent(function(){
BitlyCB.myShortenCallback = function(data) {
// this is how to get a result of shortening a single url
var result;
for (var r in data.results) {
result = data.results[r];
result['longUrl'] = r;
break;
}
document.getElementById("shorturl").innerHTML = "<div id='shorternh2'>Surprise your friend with this fact! Share this link in your Status!</div> <input type='text' class='textinpo' value='" + result['shortUrl'] + "' name='bitlyurl'/>";}
BitlyClient.shorten(document.location, 'BitlyCB.myShortenCallback');
});
</script></div>
</b:if>
<!-- Short URLs Script by MBL -->
Congratulations: Once everything is down, simply press the “Save” button and automatic shorten URL script is ready, and good to be live on your website. Now go and check your website to see the Automatically Generate Short URLs of Your Posts in Blogger.
We hope this article has helped you to learn How to Auto Generate Short URLs of Your Posts in Blogger with Bit.ly. What are your thoughts about this automatic script, which we have brought for all guys out there? Which URL shortening service you are using? If anyone has any problem while applying this tutorial then, do not hesitate to leave a comment below.

The Editorial Team of MyBloggerLab consists of a group of Professional Blogger geeks Led by Syed Faizan Ali (Founder of MyBloggerLab).
17 comments
Nice Post Bro Keep It Up Allah Bless You
Awesome Post Faizan bro :) I use goo.gl to short links but you share awesome tip to short the link automatically.. Thanks
Awesome post !
Bit.ly is my favorite tool to shorten my blog post URL's.
This is one of the best tools created you , Faizan bro !
You have did a great job for us .
Thank You ..
Could you repeat your post with adf.ly site.
We as blogger wants to help ourself by some money in running blogs. so its good for earning....
By the way great post
Finally i found already this, I spend my time searching this kind of plugin for blogger. And you guys definitely awesome.Thank you so much. I add already to my blogs...Keep sharing..
oh i think i did something rong and my blog became so messy :S:S:S
Can i have your email add pls:(
contact.mybloggerlab.com << use that!
nice post, thx
Nice Post Brother...Keep it Up....
thanks... im willing to translate this to indonesian language and post it at my blog at etchingsoul.web.id with a backlink to this post... :D
is there any method for goo.gl google short url service ?
Not yet, if we will develop something like that we will surely share. Stay tuned.
It's nice for an short url with biy.lt
Thanks for the post's.
Nice
Post a Comment
We’re eager to see your comment. However, Please Keep in mind that all comments are moderated manually by our human reviewers according to our comment policy, and all the links are nofollow. Using Keywords in the name field area is forbidden. Let’s enjoy a personal and evocative conversation.