WordPress URL Shortening: An Interesting Consequence

Long post and page URLs can be annoying. There are times when you may want to edit WordPress slugs for long titled posts or pages, so you can share a shorter link with friends. Here’s an example: http://wpgaurav.wordpress.com/2011/02/06/derivative-of-x-squared-is-2x-or-x-where-is-the-fallacy/ (one of the most popular posts from my blog). Would you like to write these (about) hundred characters? Or would you like to use WP.ME link shortener, which for this post was http://wp.me/p14tlY-hv ? Well, second idea sounds better than first one. But you’ll never get the same satisfaction from it because blog URL http://wpgaurav.wordpress.com is not visible, and also looks odd when typed in address bar. What then? This post is on some choices you might want to try. But before we go, let me explain what slug is? wordpress-featured.jpg
A slug is a few words that describe a post or a page. Slugs are usually an URL friendly version of the post title (which has been automatically generated by WordPress), but a slug can be anything you like. Slugs are meant to be used with permalinks as they help describe what the content at the URL is. The post slug is the part of the URL after the date in a post’s URL. When the default post slug is created, all letters will be converted to lowercase, spaces will be exchanged with dashes, and any special characters will be removed. You can modify the post slug by clicking the Edit button next to it in visual editor. When you’re finished editing, click Save and then Update Post/Page. »via WordPress Codex

How to shorten a WordPress post or page slug with a more efficient way?

Here are some interesting ways to define a personalised, very short and share-friendly version of URL for your post.

  1. Eliminate the ‘time-stamp’ from the slug and
    http://wpgaurav.wordpress.com/derivative-of-x-squared-is-2x-or-x-where-is-the-fallacy/
    redirects to the same post at
    http://wpgaurav.wordpress.com/2011/02/06/derivative-of-x-squared-is-2x-or-x-where-is-the-fallacy/
    So it got a little shorter.
  2. Want it to be even shorter? Then cut one or more characters from the URL: For example:
    http://wpgaurav.wordpress.com/2011/02/06/derivative-of-x-squared-is-2x-or-x-where-is-the-fallacy/
    http://wpgaurav.wordpress.com/2011/02/06/derivative-of-x-squared-is-2x-or-x-where-is/
    http://wpgaurav.wordpress.com/derivative-of-x-squared-is-2x-or-x/
    etc.  are equivalent and redirect to the same post.
  3. Want it be shorter still? Then eliminate everything but single word. e.g., http://wpgaurav.wordpress.com/derivative/
    Looks cool, no? Yes, Just like a Page URL on WordPress.com! And it redirects to the same post as all other links above.
  4. Is the word too long for you? Then abbreviate it to
    http://wpgaurav.wordpress.com/der/
  5. Want it be still shorter? Try the shortest, a single letter: http://wpgaurav.wordpress.com/d/ ! Well, it does not redirect to http://wpgaurav.wordpress.com/2011/02/06/derivative-of-x-squared-is-2x-or-x-where-is-the-fallacy/
    Where does it go? It goes to d’ Alembert’s Test of Convergence . Reason is specified below at point 2.

Here are some points, which follow and guide you on shortening URLs:

  1. Hyphens are not important when considering shortened-urls.
  2. Any URL of the type http://wpgaurav.wordpress.com/d redirects to a post/page which slug starts with ‘d’. If there are two posts having slugs starting with the same letter of the alphabet (here d),then it will, in alpahabetical order, redirect to that post which first word (if same then second word) comes first in English Dictionary. For example http://wpgaurav.wordpress.com/d will redirect to http://wpgaurav.wordpress.com/d-alembert/ rather than to http://wpgaurav.wordpress.com/derivative/
  3. If two/more posts have the same slugs and you are using an identical shortener that it might go to any of them, then that will (should) redirect to the post which was published earlier.
  4. Some slugs are not allowedin posts or pages on WordPress.com and they are:
    • Periods(.) are not allowed in slugs.
    • /activate/
    • /category/
    • /comments/
    • /feed/
    • /i/
    • /next/
    • /signup/
    • /tag/
    • /wp-admin/
    • /wp-content/
  5. You can not shorten your post URLs /page URLs (this way) until published.
  6. This trick also works for self hosted WordPress.org blogs.

So, are you going to experiment with your WordPress.com Post URLs?

Disclaimer: There is no technical basis for these shortening tricks. They are soley based on experiments with WordPress.com slugs. This post was made under supervision of timethief, I am grateful to her. I would also like to say thanks to Ganesh Dhamodkar, who was the guy I tested all these with.
Feel free to comment if you are getting any problem in shortening URLs or if just want to say ‘Hi’.

Long URL for this Post: http://wpgaurav.wordpress.com/2011/11/24/wordpress-url-shortening/

Short URL for this post: http://wpgaurav.wordpress.com/wor/

About these ads

15 thoughts on “WordPress URL Shortening: An Interesting Consequence

    • Hi Robyn! Thanks for liking the post. Eliminating date is a good idea for all WordPress.com blogs but looks awesome to those who have own top-level-domain like you and TT. teamoyeniyi.com/something for any post!!— Looks great in my view.

  1. Thanks for detailing this so clearly, nice work! I have often wondered what a slug was. I remember that thing about the dates, and that you are supposed to take them out if you link to old posts in a new post as well, but I don’t always remember to do it. I am very grateful to you :)

  2. Thats a great tip Gaurav. I found a url shortining service that you and your readers might find useful as well for link shortning at http://www.dot.tk where you can setup an unlimited amount of url’s, associate an email address with them, setup email only addresses and much much more.

    If you have a blogpost you really want to highlight, promote and make easy to remember you might give them a look as well, I’ve been using there service for a long time now and have found it to be a reliable and useful service.

    cheers.

  3. Pingback: WordPress URL Shortening: An Interesting Consequence | MY DIGITAL NOTEBOOK

  4. Interesting post. Me, a beginner, I don’t really understand “slugs.” By eliminating the date on wp.com links, I can see that it makes it easier to tell others how to find a specific post. So making the link even shorter and simpler makes it easier to tell someone how to find one of your posts?

    I write about Japanese cooking and most of my friends can’t even remember the link to my blog unless I email it to them. Sorry if I’m being dense here. (I know I am…)

Got to say something? Leave that here:

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s