A little bit about WordPress permalinks

WordPress permalinks are a very important part of how your site works. It is therefore important that you know a little bit about them.

How to set permalinks

The default permalink structure is called plain, and look something like:

example.com/?123

this is the default, and will work in any server environment. It does not require Apache mod_rewrite, or any other web-server’s equivalent, as all requests are automatically put through index.php

If you change the permalink settings, then Apache mod_rewrite, or the web server equivalent is required, unless you use PATHINFO permalinks, which can be accomplished by adding index.php to the permalink structure. So, an example permalink is:

example.com/index.php/post-title

Which one is the best?

There is no correct answer that will apply to all blogs. Some are fine with the date, some work fine with the post title, and others use the same as me: category + post name

How to create custom permalink structures

You can create a custom permalink by going into the permalink settings page in WordPress and editing the text box to use any of the following tags:

%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

%post_id% - The unique ID # of the post, for example 423

%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.

%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.

My config is:

/%category%/%postname%/

Leave your favorite permalink structure in the comments!

Sources: WordPress Codex

Leave a Reply(Markdown is On)