Setting the best Permalink Structure

I must admit – I gave Wordpress less credit than it deserves. If you haven’t noticed, I’ve recently changed my permalink structure – if you are too lazy to follow the link or were overwhelmed by it, here is the relevant bit:

Permalinks are the permanent URLs to your individual weblog posts, as well as categories and other lists of weblog postings. A permalink is what another weblogger will use to refer to your article (or section), or how you might send a link to your story in an e-mail message. Especially when they are used to link to individual postings, once a story is posted, the URL to it should be permanent, and never change. Hence.. permalink.

Structure Tags

You can use the structure tags to customize your permalinks.
%postname%
A sanitized version of the title of the post. So “This Is A Great Post!” becomes “this-is-a-great-post” in the URL.
%post_id%
The unique ID # of the post, for example 423

My earlier permalink structure was /%postname%-%post_id%/ which means that it includes both the post’s id and the title. According to this structure, this post would have the URL of iamkarthik.com/setting-the-bes t-permalink-scheme-15/ (15 is the id of this post). Can you imagine the confusion it would cause if I were to make a list post? If I were to post an article on the “21 Best Wordpress Themes” and the post id were to be 25, the URL of the post would look like iamkarthik.com/21-best-wordpre ss-themes-25/. Now I don’t know about you, but it looks very silly to me. Then why did I include the post id in the URL? The logic behind it was that in case I would ever need to change the permalinks, I could redirect the posts based on the id. I was also taking a precaution against duplicate post titles – its easy to make two posts with the same title (post titles such as “Weekend Reading” are most likely to be created every week) and I didn’t want to set my blog on fire by having the same URL pointing to two different posts.

But Wordpress is smarter than I thought.

Now I’m one of those guys who likes to see some proof before they believe what they are told. To do that, I setup a test blog and set the permalink scheme to /%postname%/ (Go to your Administration Panel–>Options–>Permalinks). Next, I posted an article which we shall call “test post”. If you’ve been paying attention, you would know that it would have had a URL of /test-post/, after which I renamed the post to point to /new-test-post/. To complete the test, I typed in /test-post/ in my browser’s address bar and I found Wordpress giving me a sly grin and showing me /new-test-post/!

Ok, so it won on this count. I still had to know what would happen if I posted two articles with the same title. To test this, I made another post with the title “new test post” which would generate the same URL of that of my previous post. But it was strike two for me when I found out the URL of the new post – it was /new-test-post-2/. Notice the number “2″? WP added that to show that there was a post with the same title already. Neat. So no two posts will have the same URL.

I guess I stretched it a bit too far when I created a page with the same title, “new test post”. I salvaged some of my ego there, because WP seemed to display the page that I created for the URL /new-test-post/ rather than the post with the same title.

Three facts present themselves at this point:

  • Wordpress is smart.
  • Its smarter.
  • It gives more importance to pages than posts (which is why it displayed the page rather than the post).

Well, once it became clear that the id of the post was not required, I set out to find the best permalink scheme for search engine optimization. Search engines give a lot of importance to the keywords in the URL and so its obvious that the post title must be part of it. I decided against adding the category of each post so as not to reduce the keyword density in the URL. It also helps to keep the URL short.

Over 90% of the blogs that I’ve visited/read seem to use a permalink structure of /%postname%/. This is bad for SEO for two reasons, one is that it causes a duplicate content penalty if anyone linked to your blog as /%postname% without the trailing slash. Quoting the above example, iamkarthik.com/new-test-post/ and iamkarthik.com/new-test-post would lead to the same content under different URLs. This is strictly against Google’s Webmaster Guidelines. The second reason that this is bad SEO is that, as far as search engines are concerned, the post is on the second level from the domain and hence will be given less importance. Each level can be assumed as a folder, for example, if I have a page called abc.html at iamkarthik.com/subfolder/abc.h tml and xyz.html at iamkarthik.com/xyz.html; abc.html is on the second level, while xyz.html is on the first level thus giving more importance (PageRank) to xyz.html.

So how do we avoid this? We can choose a permalink option of /%postname% or /%postname%.html (or /%postname%.php). I decided to go with /%postname%.html for the simple reason that web-surfers are more accustomed to seeing the extensions of html or php and a page without an extension might confuse them and some may even add an extension of their liking (others may add the trailing slash which would end up in a duplicate content penalty again!). To avoid that, I’m now sticking to /%postname%.html. From the example, the post title would now look like iamkarthik.com/new-test-post.h tml

I’m also using this excellent plugin to redirect my old links to the new ones so that I don’t lose any of the links pointing to my old posts. Wordpress 2.3 does it automatically.

If you found this article useful or have a different opinion, do let me know in the comments.



Stumble It! Bookmark on del.icio.us

You may also like to read

→ Popular Posts
→ 9 Plugins to kick-start your Wordpress blog

28 comments ↓

#1 CHESSNOID on 09.28.07 at 11:20 am

I think using permalinks is good. I have wordpress and changed after reading an article similar to yours. Some SEO experts recommend that using more descriptive permalinks will give search engines a better way for looking up your site. Anyways, I am glad I converted my blog over. Good useful post!
;)

#2 Karthik on 09.28.07 at 3:09 pm

Yes, using “pretty” permalinks is one of the simplest SEO change you can do to your blog. Its a pity though that many blogs still use the conventional form and complain about lack of search engine visibility!

I’m glad you’ve converted – I’m sure your results would have improved!

And as always, thanks for visiting!

#3 CHESSNOID on 09.28.07 at 5:04 pm

My pleasure. I like being able to relate to other bloggers going through the same things I am or was going through. It helps build a community bond I think.

#4 Weekly Links << Vandelay Website Design on 09.29.07 at 2:52 pm

[...] Karthik – Read Karthik’s recent post Setting the Best Permalink Structure. [...]

#5 Karen Zara on 10.03.07 at 1:34 am

First time visitor here. :) I’ve found you via MyBlogLog, although I guess we’ve been posting comments on the same blogs, for I recall having read your name on other places.

Very good article. I was still undecided about the right permalink structure for my blogs, but your post gave me a great idea: adding that .html extension after the structure tag. I didn’t even know it was possible. Thank you for sharing these tips. :)

#6 Karthik on 10.03.07 at 4:09 am

MyBlogLog does send me visitor off and on :)
And yes, I believe I’ve noticed your name too!

I noticed you have the /year/month/day/postname/ type URL – does wordpress.com let you install plugins? If you are to change to the postname.html format like I have,you’ll need the plugin that I’ve mentioned at the bottom of the post, or something similar so that you don’t break your older URLs!

Thanks for reading and hope you’ve subscribed to my feed? ;)

#7 Monika @ The Writers Manifesto on 10.08.07 at 3:29 am

Karthik,

I also use the year/post/month/day/postname structure

Not sure what I need to do now? I don’t want to use the html extension at this stage and I admit all these permalinks talks exhaust me. It’s like following a particular fashion and number 1 says go there and number 2 says no, no go there instead.

It’s rather confusing to be honest and I see that you can back up your post with some proof of data due to your trialling it all out on another blog.
I guess if your PR suddenly climbs up like mad, then I’ll have to follow suit won’t I? :-)

Great post by the way, it just confused my already confused state about which way to go even more. (Not your fault BTW) :-)

Monika

#8 Karthik on 10.08.07 at 3:22 pm

Lol, I hear you Monika, its easy to get lost in the sea of technicalities.

And I do subscribe to the content is King philosophy. What I also add is, you are sure to be rewarded for writing good content, there is no doubt about that – the question though, is if you want to be rewarded sooner or later! But like I said, the URL of the post is not the only factor, there are certainly more important factors such as the title of the post and the quality of the content in general. But if making a simple change helps you in being rewarded earlier by 5%, personally, I would do it. Especially when there are no known disadvantages in using this method!

Darren of Problogger.net is perhaps one of the biggest proponents of the URL structure that you use. But its common agreement that the year/month/date/postname is at a certain disadvantage. In the end, its really your call :)

#9 Karthik on 10.08.07 at 4:36 pm

@Monika
I’d read this post earlier, but I bumped into it again: http://www.searchenginejournal .com/seo-friendly-url-structur e/4556/#comment-426969

The comment quotes Loren as saying what I mention in the post. That just about sums up what I meant in my previous comment. The other comments may work to confuse you, there is no need to add the post id in the URL AFAIK.

Hope that helps!

#10 Setting up a WordPress blog | .EDU Guru on 01.12.08 at 3:10 am

[...] There are many discussions about the best way to do this.  You can read about it here, here, here, and finally this one has a few tips from the infamous Matt Cutts.   I’ll let you decide for [...]

#11 David VanBuren on 02.05.08 at 6:21 am

Thank you for the tip. I found your website on a google search phrase “best permalink structure”. /%postname%.html is the way to go.

#12 Rief . Di Solo . Com » WordPress Post Install Check List on 02.13.08 at 2:56 pm

[...] offers you to be able to set permalink for your favor. There a lot of reference for you to choose the best permalink that suits on you and search engine. Options > [...]

#13 AverageCoder.Net - Programming and Blogging on 03.02.08 at 1:49 am

Change the WordPress permalink structure to the best format, and yes it’s a little bit scary :D

Today this blog is about 2 months old. It is only 2 weeks ago when I began to put more attention on how search engines see my pages. Let me be honest with you that at this moment the search result from this blog on Google looks bad.
Speaking about sea…

#14 Tengo, goeszen.com on 03.29.08 at 8:22 pm

Absolutely true! I strongly advocate for using a properly extended URL like ../thispost.html. I can’t understand why WP used the trailing slash layout in the first place. When you are referencing a single page, without much subcontent, there isn’t a true use for using a pseudo-directory…

#15 The Blog Business Toolshed : The Blog Herald on 04.11.08 at 3:44 am

[...] off the ground. Other things I didn’t really touch on are actually setting up your blog,nailing your permalink structure, and installing WordPress which is my preferred tool of choice. This is just a basic rundown of [...]

#16 Michael Aulia on 06.03.08 at 8:01 am

One of my reader said to me that trackbacks to my posts are no longer working after I changed to this permalink structure (/%postname%.html)

Does yours work? (trackbacks, not pingbacks)

#17 Karthik on 06.04.08 at 12:40 am

Michael, I’m not sure about trackbacks as I don’t use it myself as its not good for SEO AFAIK. Displaying trackback URLs lead to duplicate content, so its best to avoid them if you can since they show the same content as your post URL does as far as a spider is concerned.

Also, the same effect of a trackback is achieved if your reader references your post/blog in his post. Technically, this would be called a pingback – but its quite the same.

#18 Michael Aulia on 06.04.08 at 3:44 am

Ahh.. I see.. I asked this because one of my readers is not using a WordPress system to blog and somehow pingback doesn’t work (I think pingback only works for WordPress to WordPress, yeah?)

I can’t remember what platform he’s in (Not WordPress and not Blogger)

#19 Clyde Boom on 06.05.08 at 5:49 pm

Excellent ! Thanks for all the detail in this post.

I don’t want dates in my urls.

And thanks for testing what happens with two posts of the same name – and that WP takes care of this just fine.

I will try using /%postname%.html.

#20 Chris Butterworth on 08.06.08 at 1:31 am

Great information. I have a blog with about 550 posts, set up with /%postname%/ – and I never understood why search engines sometimes find it with and without the trailing /… Linkbacks! Doh!

Oh well. Not sure I’m going to convert that blog (2 years’ worth of posts), but I’m starting a new blog & wanted to search for a better way, if possible. Also, my new blog’s structure will be more likely to produce duplicate post titles, which is how I came to find your post.. ;-)

I’m giong to use the same structure, but without the trailing /. Thanks again.

#21 Leon on 11.28.08 at 5:19 pm

Excellent tips, I just changed it on all my wordpress blogs. Thanks)

#22 Leon on 11.30.08 at 11:35 pm

Hi Karthik, Thanks for visiting my blog. That one dollar ebook blog is on blogspot and not on wordpress, I have other blogs on wordpress which I wanted to optimize for SE. You have a wonderful blog and I will definitely be around:)

#23 5 Things To Remember When Making a Website | VikingBlog on 12.02.08 at 6:12 pm

[...] than either /%category%/%postname%/ or /%postname%/, is because of two reasons as stated over at iamkarthik.com : Setting the best Permalink Structure. “Over 90% of the blogs that I’ve visited/read seem to use a permalink structure of [...]

#24 Cajen on 01.27.09 at 12:17 am

Very informative! I should have read this back when I first started my blog. Thanks!

#25 Best WordPress Permalink Structure on 01.27.09 at 1:09 am

[...] Setting the Best Permalink Structure [...]

#26 Setting Up Permalinks in Wordpress :Junntrekker on 05.06.09 at 9:15 pm

[...] for my permalinks to be shortened, the complete explanations can be read here. Place the /%postname%.html in the Custom Structure text box and click save. You will then be [...]

#27 V.C on 06.13.09 at 4:14 am

It might be a good idea to leave a unique number in your permalinks. I often have posts with the same name and it can be troublesome unless you leave in date or post_id information. I currently use: /%category%/%post_id%/%postnam e%

#28 Karthik on 06.14.09 at 9:11 am

WP automatically adds a number at the end if it’s a duplicate title.
Ex: You have 2 posts titled “Duplicate Title”, the post slug for the first one would be duplicate-title and the second one would be duplicate-title-2. (This is also mentioned in the text of the post.)

Leave a Comment