How To Create Short URL’s on your WordPress Domain without a Plugin or Script

We see a lot of shortening services around and there are many free tools that will help you create one on your domain.

The logic is simple, there is a database, there is a long url and an associated short url. When someone access the short url, the long url is fetched from the database and the user is redirected.


Short URL Redirects to Long URL

If you are on WordPress you wont need any of those. Inherently, every post can be queried from the database using its post ID. For instance, this link and this link point to the same post.

Your short urls for all your WordPress post will be in the following format:

yourdomain.com/?p=POST_ID

To find the POST_ID of a post, just go to your Posts > Edit Page in WordPress Admin and hover over the title of the post and check the link on the status bar. The last number that you see is the POST_ID of the corresponding post. See the image:

WordPress Post ID on Status Bar

Now with this knowledge you could create your own Retweet Button’s and use the link in Twitter :)

Related: Handy Bookmarklets for 7 Popular URL Shortners

Awesome WordPress Themes!

You May Also Like To Read:

  1. Browser Bookmarklets for Popular URL Shortners
  2. Disable TweetCount Plugin on Specific WordPress Pages
  3. 3 ways to Change WordPress Default Username
  4. How to use WordPress to Create a User Generated Content Site
  5. Quizzes Made Easy With Quizzin – WordPress Plugin

This entry was posted in WordPress and tagged , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

For More Like, "How To Create Short URL’s on your WordPress Domain without a Plugin or Script"
Grab the Feed or,

8 Comments

  1. Posted July 21, 2010 at 23:09 | Permalink

    Oops.. I thought something really shorter than that is what you are talking about :P

    • Posted July 22, 2010 at 00:38 | Permalink

      I wrote this as a reply to a discussion I saw on Facebook, didn’t think that there would be people who didn’t even knew this ;)

  2. Posted July 26, 2010 at 06:06 | Permalink

    Whoa… Those are eastsheen cubes, am I right?

    I personally use Meta refresh for redirection :-)

  3. Posted August 2, 2010 at 00:01 | Permalink

    I never thought about this mate. Now i can use my domain’s short URL in tweets. Thanks for sharing this tip mate.

  4. Posted August 8, 2010 at 11:32 | Permalink

    This is not a good feature :( .

  5. Posted August 18, 2010 at 19:02 | Permalink

    I knew this , but you know , every time i delete that specific post , and create new one
    you get different url . The order is not maintained :( by the way , i thought free short url like domain.com/abcd :P

  6. Posted August 19, 2010 at 10:09 | Permalink

    For those who are disappointed with the solution,
    http://kovshenin.com/wordpress/plugins/twitter-friendly-links/

    Nice & Easy!

    Good post, Arun.
    Even better is the self-clicked photo. :)

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting

  • Get Free Updates

Home · Archives · About · Contact · Advertise · Hire Me · RSS
© 2006 – the end of time, Arun Basil Lal. Powered by WordPress, H2O and an Awesome Bunch of Friends.