Home » Posts tagged 'Blogging Tips'

Tag Archives: Blogging Tips

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/

Follow

Get every new post delivered to your Inbox.

Join 755 other followers

%d bloggers like this: