The following snippet will let you create shorter URL for WordPress posts.

Snippet Source/Credit: Snipplr