Create Short URLs with WordPress
As the growth of social media marketing is increasing, url shortening services are also flourishing in parallel. For our purposes here, instead of displaying the normal SEO Friendly URLs, we are displaying the original Post-ID URL which WordPress generates with each post created. But it is very simple to create a short URL with WordPress using this.
To do this, just paste the following code anywhere in your single.php–
<?php echo get_bloginfo(‘url’).”/?p=”.$post->ID; ?>
and it will display a URL like this:
It will not change 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. By this hack you can shorten your page and post URLs, which comes in handy for Twitter. Now, to shorten an external URL using WordPress you need the plugin Short URL Plugin.
This plugin lets you create a short URL like:
It works like an analyzer, so it also lets you track how many clicks each URL has received. It should be noted that this will only work if you have a short domain.
Customized Short URL for Your Blog
A custom branded short URL is great for building a personal or business brand, as readers will know exactly where it will lead when they see it shared on social networks. Top brands like the New York Times, TechCrunch, BuySellAds, and others have been using their own customized short urls like “nyti.ms”, “tcrn.ch”, “bsa.ly” and so on. In this article, we will share how you can get your own customized short URL for your WordPress blog.
Step 1: Buy a Short URL
At first you need to type the words that you want to include in your short URL, and then Domai.nr will provide a variety of domain extensions (TLD). It will also inform you which of these options are available to purchase. You need to confirm your Domain name is less than 15 characters. Pick the domain you want and then register from the top domain registration company, Godaddy.
Step 2: Register for Bit.ly Pro
Step 3: Set an A Record to Point to Bit.ly
You will have to find where you can manually add a DNS entry and enter the details provided by bit.ly. You need to set an A Record, or DNS Host, for your short URL to point to the IP address of bit.ly. If you use Godaddy to register your domain, the A record is located under the “Total DNS” tab, so login and add the DNS record and point it to the IP 126.96.36.199 (this is the IP of Bit.ly).
Step 4: Verify Your Site
Once you have added the record you should be able to verify that through bit.ly. Next you need to add a ‘tracking domain’ in order to get access to all of the analytics in bit.ly. Enter the domain name you want to track (your blog’s actual domain would go here) in your Bit.ly account. This domain will not be the same as the short URL that you just set up. After you verify that you own your site, bit.ly will automatically convert any links you have shortened from that site to your custom short URL.