A Collection of WordPress-based Short URLs

Nowadays pretty much everybody is using pretty permalinks while also using the much shorter url.com?p=page_id format for the short URL of the same post, usually on Twitter. You can also use the various URL shortening services, of course, but Zeldman’s article explains why it’s good to roll your own short URL:

Rolling your own mini-URLs lessens the chance that your carefully cultivated links will rot if the third-party URL shortening site goes down or goes out of business

This post will show you a few more unique keywords (not just “p”) that you can use to shorten your URL with WordPress. You don’t need to do anything to get these keywords to work; they’re available to any WordPress install and will still work regardless of your Permalinks setting.

p

Links to a certain Post / Page.

Usage: url.com/?p=(Post or Page’s ID)
Example: wplover.com?p=1426

m

Either links to Posts from an entire year or an entire month.

Usage:

  • To link to a certain month’s Posts: url.com/?p=(YYYYMM)
  • To link to a certain year’s Posts: url.com/?p=(YYYY)

Example:

  • wplover.com/?m=201001
  • wplover.com/?m=2010
  • cat

    Links to Posts from a certain category.

    Usage: url.com/?cat=(Category ID)
    Example: wplover.com?cat=3

    tag

    Links to Posts tagged with a certain tag. Note that you use slug instead of ID here.

    Usage: url.com/?tag=(Tag slug)
    Example: wplover.com?tag=awesome

    s

    Links to search results for your supplied keyword.

    Usage: url.com/?s=(Keyword)
    Example: wplover.com?s=design

    Any other short URL keyword I missed?

    You may also like...

    1 Response

    1. The Frosty says:

      Was just playing around with this yesterday.

      You could also use a .htaccess trick to rewrite short URLs.

      RewriteRule ^post/([0-9]+)?/?([0-9]+)?/?$ /index.php?p=$1&page=$2 [QSA]

      Which would allow for url.com/post/(Post ID)

    css.php