short-urls

With social media marketing on its peak, and URL shortening service at it’s highest demand, bloggers are turning to services like tr.im, bit.ly, or even ekey.us. There are two disadvantages of using these services. First they are not brandable, and second they are not reliable as tr.im said they will be closing down. Much thanks to a powerful script like WordPress, we can now use it to create short URLs and have our brand in it.

*Note: You cannot use this tutorial if your domain is too long.

This hack is very simple. All we are doing is instead of displaying our normal SEO Friendly URLs, we are displaying the original Post-ID URL which WordPress generates anyway with each post created.

 

All you have to do is copy and paste the following code in your single.php wherever you like.

1 <?php echo get_bloginfo('url')."/?p=".$post->ID; ?>

and it will display a URL of this sort:

http://wpbeginner.com/?p=734

Now for those of you who do not know how you will be using this code, stay updated as we will be showing you how to use this for different social media sites in our next tutorial.

This hack is not changing your SEO Friendly URLs, when someone types this URL in the box, or clicks on this URL, the URL they will actually see is your long permalink that you made using our SEO Friendly URLs tutorial.

This hack only lets you shorten your page and post URLs, but if you want to shorten an external URL using your WordPress, you can also do so by using a plugin called Short URL Plugin.

This plugin lets you create a short URL like:

http://wpbeginner.com/u/23

It also lets you track how many clicks each URL has received, so it is also a great analyzing tool. But once again this will only work if you have a short domain.

These features are handy and a good substitution until ofcourse Matt Mullewang and Automattic release the plugin for WP.me to be used on WordPress.org’s self-hosted blogs. Currently WP.me urls are only reserved for WordPress.com users as announced by Matt on WordPress Blog.

Remember to stay updated for our next tutorial in which we will show you how you can add share this links to popular social media sties.

From http://www.wpbeginner.com/