Whenever you publish a post or page in a WordPress blog, a short URL of the post is created in the form of http://www.domain.com/?p=2314, where 2314 is the unique ID of the blog post or page.
This short link feature is handy, when you want to share your post on social networking websites e.g Facebook, Twitter or put the URL of the blog post in the description field of a YouTube video. You have to remember only the ID of the blog post and not the entire slug.
These short URL’s also help in branding because the reader can guess the name of the blog just by looking at the short URL.
If you want to integrate Bit.ly URL shortener within WordPress and want to generate short URL’s of WordPress posts using Bit.ly, here is a simple WordPress plugin from Yoast, which will come in handy.
After the plugin is installed, login to your Bit.ly account and find the API key from settings page. Then add the following code to the wp-config.php file of your WordPress blog (remember to replace the username and API key with your own Bit.ly username and corresponding API key)
define(‘BITLY_USERNAME’, ‘ Bit.ly username’);
define(‘BITLY_APIKEY’, ‘ Bit.ly API key’);
Save the wp-config.php file and upload it back to your web server. All done, the Bit.ly plugin is now integrated with WordPress and whenever you publish a new blog post or page, you will automatically get a Bit.ly short URL for the blog posts.
To get the short link of WordPress posts shortened using Bit.ly, just hit the “Get Shortlink” button next to “View post”, under WordPress “Write post” panel.
Recommended for those blogs who have a long domain name and the default short URL generated by WordPress is too long to be shared on social sites.
Tip: Who is stealing your tweets or shortened links