Feb 022012
 

EDIT June 16, 2012: These shortened links suddenly stopped working after I updated WordPress to version 3.4 and went back to normal with update to WordPress 3.4.1.

Shortening links to my posts on my own
Here is a trick that lets me easily shorten links to my posts and stay clear of any link shortening tools, sites and utilities. I’ve discovered this by accident, but here’s how it works, thanks to my chosen permalinks settings.

For example this page can be accessed by its full original link:

http://deputycio.com/5481/shorten-wordpress-post-links
and that’s also how I usually link to it from other posts and sites.

However, it can also be accessed by this link:

http://deputycio.com/5481
See the benefit? MUCH shorter!

What’s the other beauty of using a link shortened this way? If I ever decide to change the wording in the permalink of a post, the same shortened link will still work, and so will my twitter posts and any other enchiladas using these links. The full old link won’t.

Now, external links (from other sites) and the search engine links and rankings are another story so I’m not saying you should go around changing your permalinks structure and wording every day, because you may significantly lower the number of your visitors and search engine hits. Still, I find this trick extremely useful for my twitter posts and I don’t need to use any services to shorten my links.

Why does this work?

The structure of my permalinks is: /%post_id%/%postname%

The post_id variable is a number assigned automatically by WordPress each time I add a new post. The postname variable is actually also set automatically by WordPress as well, but I have an option to edit and change it my WordPress post editor. Now if you look in your post editor you will also see a “Get Shortlink” button close to the permalink “Edit” button, but that actually gives me a bit longer link than my tweak, as the shortened link to this page would be http://deputycio.com/?p=5481, while my own shortened link doesn not include the cumbersome ?p= part and it still works as http://deputycio.com/5481. Anyway, when your link hits my web server it goes to this post id and since there is one and only one post name associated with each post id, boom, it goes for it and displays it.

– – –

Disclaimer: those with an established WordPress blog with a lot of posts, external links, and good results in search engines should carefully evaluate benefits vs possible consequences of changing permalinks, so don’t rush into this. This works for me just because my permalinks are already set in a way that allows this great and simple method to work and it’s easy to do for those just starting, or those with extremely low traffic that would be virtually unaffected with such a change of their permalink structure. There are also some redirection plugins that can take care of any kind of permalink changes, and there are also .htaccess redirection tricks, but that would be another post.

Enjoy!

– – – – – – – – – – – – – –

If you find these notes helpful, tip me! Give me a dollar or few using the “Tip Me” link on top.

 

 

 Leave a Reply

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=""> <s> <strike> <strong>

(required)

(required)