WordPress URL Shortening: An Interesting Consequence

Please Share this:


Long post and page URLs can be annoying. Take an example: https://gauravtiwari.org/2011/02/06/derivative-of-x-squared-is-2x-or-x-where-is-the-fallacy/(one of the most popular posts from my blog). Will you like to write these (about) hundred characters? Or will prefer URL shorteners, like bit.ly or wp.me, instead? As third option, will you just copy and paste the URLs to anywhere you want to share? Second idea is fine but third is awesome. But using shorteners will never give you the same satisfaction as first and third will do, because blog URL https://gauravtiwari.org is not visible, and also looks odd to see characters (like1xYzKl3n). What then? Copy-paste method appears the best method among all three. This post is about the fourth strategy of sharing URLs, you may want to try. The fourth strategy involves WordPress URL shortening techniques done without any external scripts or plugins.

WordPress URL Shortening: Explained

But before we proceed, let’s know what actually a ‘slug’ is?

[wc_box color=”primary” text_align=”left”]

A slug is a few words that describe a post or a page. Slugs are usually a 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 personalized, very short and share-friendly version of URL for your post.

  • Eliminate the ‘time-stamp’ from the slug and

    Derivative of x squared is 2x or x ? Where is the fallacy?

    should redirect to the same post at
    So it got a little shorter.

  • Want it to be even shorter? Then cut one or more characters from the URL: For example:
    https://gauravtiwari.org/derivative-of-x-squared-is-2x-or-x/ etc., are equivalent and redirect to the same post.
  • Want it be shorter still? Then eliminate everything but single word. e.g., https://gauravtiwari.org/derivative/
    Looks cool, no? Yes, Just like a Page URL! And it redirects to the same post as all other links above.
  • Is the word too long for you? Then abbreviate it to
  • Want it be little more short? Try the shortest, a single letter: https://gauravtiwari.org/d/ ! Well, it does not redirect to https://gauravtiwari.org/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 . (URL= https://gauravtiwari.org/2011/04/09/d-alemberts-test-of-convergence-of-series/) Why ?
    Reason is specified below at point 2.

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

  1. Date stamps are not important when writing shortened-urls. You may totally ignore them from the shortened URL or just leave them as they are.
  2. Any URL of the type https://gauravtiwari.org/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 alphabetical order, redirect to that post which first word (if same then second word) comes first in English Dictionary. For example https://gauravtiwari.org/dwill redirect to https://gauravtiwari.org/d-alembert/ rather than tohttps://gauravtiwari.org/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 chose to go to the post which was published earlier.

Some slugs are not allowed in posts or pages on WordPress and WordPress.com due to security reasons.

  • Periods(.)
  • /activate/
  • /category/, /subject/ (or any category base slug, which is chosen from Setting –>> Permalinks).
  • /comments/
  • /feed/
  • /i/
  • /next/
  • /signup/
  • /tag/, /topic/   (or any tag base slug, which is chosen from Setting –>> Permalinks)
  • /wp-admin/
  • /wp-content/

PS: You cannot shorten your post URLs /page URLs (this way) until they are published.

This trick works for both, the free WordPress.com and self-hosted WordPress.org blogs.

14 comments add your comment

    • You are welcome, Ankur! Leave another comment if you have any questions or troubles.

  1. Good job Gaurav. I didn’t think we could get rid of the date in the slug, so that is interesting – I’ll have to try that!

    • 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.

  2. @Gaurav Tiwari
    Thanks so much for this useful tutorial. I have done a Press This so my regular readers like Team Oyeniyi will click through and find it.

    • Thank you very much TimeThief, for your support in both preparation and promotion of this post! (BTW PressThis links to homepage, not to the permalink.)

  3. 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 🙂

    • I am also grateful to you that you gave your precious time to this post. 🙂

  4. 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 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.


  5. Completely amazing Gaurav! Its like WordPress just got better for me 🙂
    BTW – PressThis links to whatever post or page you Press it on 😉

    • Thanks for your Reply Manveet. WordPress is great and its pseudo-features are amazing. 🙂 More you use them—the more you discover.

    • On WordPress.com and if you wrote thousands of posts, it becomes complicated to remember the post IDs.

  6. 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…)

Leave a Comment