How to get tiny Urls for WordPress automatically

URL shortening is an important part when you play blogs with social media. You can get short url in two ways first is a third party services like and other is using of a WordPress Plugin. Here we are going to make short urls by first method, that is using For doing this place below codes on appropriate places of your WordPress theme as described below.

Add to functions.php

function getTinyUrl($url) {
    $tinyurl = file_get_contents("".$url);
    return $tinyurl;

Add to single.php

	$turl = getTinyUrl(get_permalink($post->ID));
	echo 'Tiny Url for this post: <a href="'.$turl.'">'.$turl.'</a>'

Related posts:

HTML5 page structure

HTML5 offers more powerful structure comparing to older versions of Html. There are many new …

Partner with Us

We are providing an exclusive partnership offer to individuals and companies who are interested in setting up their own web design & development company. For more information about how to partner with us, please contact us