The Best Permalinks Structure

The default permalink structure for wordpress is something like his: http://blogname.com/?p=123, where “123″ is the internal ID of the post. I totally disagree with that structure and I’m not the only one in this world who thinks meaningless and useless for SEO purposes. It doesn’t help in any ways your rankings or your placing in the SERPs. This is obvious because one of the most important rules for SEO is having the keywords in your URL/titles. Honestly, I don’t understand why they choose that as default, but that’s not so important.

The pretty structure is something like this: http://blogname.com/2008/10/27/some-post-name. Now, the big question is: which permalinks structure is the best one? I’ll let you decide that, but, for me, one thing is for sure: the post name has to be in the URL. WordPress comes with few options for the permalinks structure:

  • Day and name, which is actually ‘year, month, day and name’. This helps the reader too as it’s like searching through the blog archive. You have the year, the month, the day, so you can easily find the post.
  • Month and name, which is almost the same with the first option just that the day is missing
  • Category and post name, for instance http://blogname.com/some-category/some-post-name. This format is used on a lot of new blogs lately. Some say that the category name is relevant to the post name, and hence improve SEO.
  • Post name, meaning just blogname.com/some-post-name. This 4th one is used on a lot of blogs as well.

WordPress offers you the possibility to go even further with your imagination, using the structure tags in your permalinks to create a custom permalinks structure. According to ‘codex’, these are the structure tags you can use in your permalinks settings page:

  • %year% – The year of the post, four digits, for example 2004
  • %monthnum% – Month of the year, for example 05
  • %day% – Day of the month, for example 28
  • %hour% – Hour of the day, for example 15
  • %minute% – Minute of the hour, for example 43
  • %second% – Second of the minute, for example 33
  • %postname% - A sanitized version of the title of the post (post slug field on Edit Post/Page panel). So “This Is A Great Post!” becomes this-is-a-great-post in the URI (see Using only %postname%)
  • %post_id% – The unique ID # of the post, for example 423
  • %category% – A sanitized version of the category name (category slug field on New/Edit Category panel). Nested sub-categories appear as nested directories in the URI.
  • %author% – A sanitized version of the author name.

You can use ‘-’ or ‘/’ to separate them, eg: /%category%/%postname%-%post_id%/

This isn’t a SEO blog so I’ll let you decide which one is the best permalinks structure for your blog. I personally support having post name and id and nothing else. Why? It’s because your post name will contain your keywords. Therefore, if the URL is short, the keyword density will be high(the concept is called relative weight of keywords). I don’t encourage having only the post name in the title, and here’s why: if you do that, the rewrite rules may make it impossible to access pages such as your stylesheet or the /wp-admin folder. That’s why it’s best to include some numeric data in the post, for instance the post ID. This will prevent you from having 2 posts with the same URL (I know you wouldn’t name 2 posts the same, but you might have 2 posts with the same name in different categories, etc … you never know).

One thing I forgot to mention is that if you already made some posts and published them with the faulty structure, there is a plugin that will help you redirect the old URLs to new ones. Here’s the link.

Hope this helps,

Peter

WordPress Permalinks – How to Deal With Them

Few days ago I wrote a short tutorial on ‘how to make your title appear in your links’, but I guess I missed something from it because one friend of mine couldn’t make it.

Here’s the post in case you want to read it:

How to Make Your Title Appear In Your Links

The problem is that, by default, hosts don’t set folder permissions to allow writing for apache and WordPress needs to write the .htaccess file on your server in order for the permalinks to work. If you go to your permalinks settings and try to change their format and see the image below at the bottom of the page, this means you have a problem with your permissions.

Here’s how to deal with this.

If you have the ‘x’ theme on your cpanel admin area, read below. If you have ‘x3′ scroll down a little.

Once you’re logged into your cpanel, hit the ‘File Manager’ button:

Once it’s open, start browsing until you reach your blog root folder. To enter a folder, use the yellow icon near the folder name. If you click on the folder name you will get a list of options on the right upper corner.

Also, please note that your blog root folder might be on your cpanel account root folder or it might be in a subfolder. For instance, if your domain is called wordpress.org and you can reach your blog by typing that address, then you have to navigate to /public_html. If your blog is located at www.wordpress.org/somefolder/blog/, then you have to navigate to /public_html/somefolder/blog. If you encounter any problems with this step, please mail me or post a reply on this post.

Now you are in your blog root folder. You have to put there a .htaccess file. If you cannot see it in the listing, then it means you don’t have it and you have to create it. If you can see it, you only have to set writing permissions for it.

Here’s how to add the .htaccess file: click on “Create new file” and you’ll see a small box in the upper right corner of your browser. Put “.htaccess” inside and hit “Create”.

Now you have to set permissions for it. To do that, click on the file name in the listing

The contextual menu will appear in the upper right corner. There, click “Change permissions” and make sure the ‘user’ and ‘world’ writing permissions checkboxes are checked. When ready, hit “Change” and you’re good to go. Now you may go to your WordPress admin area and change the structure of your permalinks.

I’ll come back later with the screenshots for the ‘x3′ theme on cpanel as it’s a little different.

Take care,

Peter

How to make your title appear in your links

I’ve seen this question many times on forums, so I thought it would be a good idea to make a post on how to have your post title appear on your links.

First, what does this mean? If you look in the address bar, you’ll notice that the URL is this one:
“http://www.wordpress-how-to.com/2008/10/14/how-to-make-your-title-appear-in-your-links”. This is an old SEO trick, now implemented in many web applications and yes, wordpress has support for it, just that it isn’t enabled by default.

The files/directories specified by the link don’t exist on your server, this is basically a redirection made by the htaccess file on your server. Therefore, when you hit “/2008/10/14/how-to-make-your-title-appear-in-your-links”, it will query the database for the post with that title and it will take you to index.php?p=somepostid. That’s all it happens in the background.

Let’s get to the point now. It’s very easy to enable this feature on wordpress. To do that, just login to your admin area, hit “Settings” (it’s in the upper right corner for the newer versions), then, from the contextual menu, pick “Permalinks” (or simply, put this at the end of your blog URL to access the page directly: “yourdomain.com/wp-admin/options-permalink.php”).

From there, you pick one of the options, which one you consider to be the best (I’m using the second: day and name) and then click on save.

Please note that your root folder (or blog folder if it’s not located in root) should be writable. If it’s not, wordpress won’t be able to write the htaccess file.

This is it. If you enounter any problems, just let me know via email or reply to this post and I’ll be happy to help you.

- Peter

  
Google Analytics integration offered by Wordpress Google Analytics Plugin

Hey, sorry to hear that!

Do you want to see this message again while on this website?
(pick an option)