WordPress Short URL using Post ID (plus its Effect on SEO)

I recently changed this site’s permalink format from wplover.com/postname to wplover.com/post-id/postname. At first this is simply done because I’m curious, but it turns out there are a couple of advantages to this:

  • Using post ID is good: “…it is best to start your permalink structure with a numeric field, such as the year or post ID.” (source)
    I’ve read somewhere that /post-id/postname/ is faster than /postname/ to process because using the latter there is no difference between a Post and a Page permalink, so WordPress have to take the time to check for that as well. If you use /post-id/postname/, the link structure for a Page will be /pagetitle/ (without ID). Try as I might, I can’t find the source from this information, so please correct me if I’m wrong.
  • …and the whole point of this post: you can use yourdomain/post-id/ as a short url, useful to post to Twitter and the like. Here’s an example: http://wplover.com/632/

How will using that post-id based short URL affect SEO, though? To find out, I tried to dig into WordPress’ code that redirects the short URL into the actual URL. This is from wp-includes\canonical.php line 202 (as of WordPress 2.8.x):

if ( $do_redirect ) {
// protect against chained redirects
if ( !redirect_canonical($redirect_url, false) ) {
wp_redirect($redirect_url, 301);

So they’re using 301 redirects according to that last line. This is the right way, SEO-wise:

301s are good for SEO value, while 302s aren’t because 301s instruct clients to forget the value of the original URL, while the 302 keeps the value of the original and can thus potentially reduce the value by creating two, logically-distinct URLs that each produce the same content (search engines view them as distinct duplicates rather than a single resource with two names). (source)

301 redirects tells search engines that that short URL and the full URL is the same and not a duplicate, which is good (because duplication reduces the value of both URL).

So, in essence, all’s good, godspeed, have fun with the short URL.

You may also like...

5 Responses

  1. SEO Plugin says:

    These easy to install the plugin from here SEO and you have such a problem does not http://www.undergroundtraininglab.com/

  2. Rose says:

    Thats so cool. I love this post u write…Will email some of my friends who interested in this…Thanks.

  3. Shubham Dev says:

    Great article! This would help me a lot!
    I’m changing my site’s permalink structure to http://www.newtab.org/1/postname :D
    Thanks a lot man!

  1. January 5, 2011

    […] 如果你看了我對這幾種固定網址設定的介紹和比較後,我想你大概也瞭解哪幾種可以使用在固定網址的標籤最有利,那麼接下來,只要把這些標籤融合起來,放進「自訂結構」裡,就可以使用兼具速度、SEO與短鏈結的網址結構,這個觀點是源自這篇文章。 […]

  2. January 28, 2011

    […] 如果你看了之前我对这几种固定链接设置的介绍和比较后,我想你大概也了解哪几种可以使用在固定网址的标签最有利那么接下来,只要把这些链接融合起来,放进自定义结构里,就可以使用兼具速度、SEO与短链结的网址结构,这个观点是源自 这篇文章 。 […]

css.php