Wordpress Permalinks SEO Best Practice

Setting up a permalinks structure in Wordpress one of the things I normally do right after installing a blog, before event getting started on the templates. However, I always seem to forget what to put in the box so I thought I would put this here to remind myself and to go over the best practices on your own site in terms of SEO.

To set the permalinks on your Wordpress install go into Settings > Permalinks and enter the following into the Custom Structure field.

/%postname%-%post_id%.html

This will make a post on your site have a URL something like this.

/this-is-a-new-post-2.html

It is also possible to create a permalink using the category slug by using the %category% option.

/%category%/%postname%-%post_id%.html

So the post above would become the following.

/news/this-is-a-new-post-2.html

This makes sense as you will more than likely create a category with a good keyword structure, but can't always justify adding the keyword into the post title. There are a few other parameters that can be used here, including %author%, %year%, %monthnum%, %day%, %hour%, %minute% and even %second%. In my opinion the only one of any real value in terms of SEO here is %author%, although your authors would have to have some very specific names. Just be careful that you don't add too much to your permalink structure or your URL will be very, very long and completely defeat the point of the exercise.

Adding in the post ID will make the URL of the post completely unique, which is good for SEO, but will also stop Wordpress falling over when posts, pages and categories all have the same name. Adding in the post ID is also good if you want your posts to appear in Google News, although other factors are involved.

Adding a file extension to the end of the URL might have no effect in terms of SEO, but I am old fashioned enough to quite like it.

Comments

I don't believe %post_id% is necessary to prevent naming collisions. I have tested this because I was concerned about the potential for a client to post multiple items with the same title. On WP 2.9.1, naming collisions do not seem to occur. Where necessary, "-2" is appended to the end of the URL. This presumably increments to "-3" etc.
Permalink
@simon - You are right that new versions of Wordpress do sort out the permalinks for posts with the same names, although it wasn't always like that. ;) However, I think adding %post_id% still gives each URL a unique identifier, which I have found important in the past.
Name
Philip Norton
Permalink
What is your take on adding the .html at the end is that necessary?
Permalink
Probably not necessary (at least in terms of SEO) as a URL is a URL; it's the content under that URL that matters. That being said, in my opinion the file extension makes the URL look a bit nicer.
Name
Philip Norton
Permalink
Thanks for this awesome post. I was looking for this kind of information on SEO.
Permalink
The reason some people suggest using post ID is not because of uniqueness, but because of performance. This is taken directly from the Wordpress Codex (Using Permalinks): "For performance reasons, it is not a good idea to start your permalink structure with the category, tag, author, or postname fields. The reason is that these are text fields, and using them at the beginning of your permalink structure it takes more time for WordPress to distinguish your Post URLs from Page URLs (which always use the text "page slug" as the URL), and to compensate, WordPress stores a lot of extra information in its database (so much that sites with lots of Pages have experienced difficulties). So, it is best to start your permalink structure with a numeric field, such as the year or post ID."
Permalink
Hey, I read a lot of blogs on a daily basis and for the most part, people lack substance but, I just wanted to make a quick comment to say GREAT blog!…..I'll be checking in on a regularly now….Keep up the good work!
Permalink
I really loved reading your blog. It was very well authored and easy to understand. Unlike additional blogs I have read which are really not that good. I also found your posts very interesting. In fact after reading, I had to go show it to my friend and he enjoyed it as well!
Permalink

hello,

how can i change my wordpress permalink into  site.com/%postname%.php?pid=%post_id%

please help me

thanks before


Permalink

You go into your permalinks admin area and add everything after site.com/ into the text area therein. Although I can't imagine why you would want to do that with such an ugly permaking structure...

Name
Philip Norton
Permalink

The reason some people suggest using post ID is not because of uniqueness, but because of performance.

This is taken directly from the Wordpress Codex (Using Permalinks):

"For performance reasons, it is not a good idea to start your permalink structure with the category, tag, author, or postname fields. The reason is that these are text fields, and using them at the beginning of your permalink structure it takes more time for WordPress to distinguish your Post URLs from Page URLs (which always use the text "page slug" as the URL), and to compensate, WordPress stores a lot of extra information in its database (so much that sites with lots of Pages have experienced difficulties). So, it is best to start your permalink structure with a numeric field, such as the year or post ID."

 

Permalink
What is your take on long URLs VS nice and concise URLs? I am thinking of having the category at the start of the post URL but is it worth it for SEO as i have heard long URLs aren't good?
Permalink

Add new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
2 + 2 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.