WordPress Permalinks: Detail Information and Configuration

A permalink is a direct public URL that points to the internal pages of your website. In WordPress, your permalinks point to your posts and pages. You can configure your permalinks to make your post, page and other links user and search engine friendly. You can create logical links for your content.

Having a good link structure is important for your website. There is no exact definition of a perfect permalink structure. But it is highly recommended that instead of using just numbers and question mark (?) in your URL structure, you should ensure that they have your page/topic titles.

For example

Instead of using:

www.WordPressBlog.com/?p=1
www.WordPressBlog.com/?p=1234

You can use URL structures like:

www.WordPressBlog.com/android-kitkat-released.html
www.WordPressBlog.com/news/android-kitkat-released.html
www.WordPressBlog.com/2014/android-kitkat-released.html
www.WordPressBlog.com/2014/04/android-kitkat-released.html

Configuring WordPress Permalinks

WordPress provides easy options to configure your post links. Just go to Settings > Permalinks to edit them.

settings-permalinks

In Permalink settings you can find common settings to set your post URL structure. You can select one of the common settings if you prefer them. Remember that the length of your permalink does not matter as long as they are reasonable.

permalinks-common-settings

The ones that are recommended from the common settings are:

Day and Name: http://www.WordPressBlog.com/2014/05/20/sample-post/ (Useful if you have a lot of posts in a single day.)
Month and Name: http://www.WordPressBlog.com/2014/05/sample-post/ (This is a common setting. Has the post name as well as year and month.)
Post Name: http://www.WordPressBlog.com/sample-post/ (Just has the post name and date is removed. This structure also looks good.)

Custom Structure

You can use special tags to configure custom structures for your WordPress permalinks. Tags such as %year% can be used for your URL structure. Just select the Custom Structure option and input tags surrounded by separators such as front slash (/) or dash (-). Having a slash is more common.

custom-structure

Here are examples of a few good ones using tags in custom structure:

Category and Post name: /%category%/%postname%/ : Creates post URLs like http://www.WordPressBlog.com/news/android-kitkat-released/

Ending in .html: /%category%/%postname%.html : Creates post URLs like http://www.WordPressBlog.com/news/android-kitkat-released.html

Using post id for speeding up your site: /%postname%/%post_id/ : Creates post URLs like http://www.WordPressBlog.com/android-kitkat-released/342/. If you have post ids can improve on your load time.

Input custom words in your URLs like: /archives/%postname%/ : Creates post URLs like http://www.WordPressBlog.com/archives/android-kitkat-released/

All the tags available for custom structure:

%postname%: Post name generated from the title of your post. You can edit it from your post compose page. Edit the permalink which is automatically generated and displayed right under your post title and above your post compose box.

%category% : The category of the post.

%post_id% : Automatically assigned unique post id in numbers. Example: 5234.

%year% : Year of the post in numbers. Example: 2014.

%monthnum% : Numerical value of the post month. Example: 05.

%day% : Day of the post in numbers. Example: 17.

%hour%: Hour of the post. Example: 23.

%minute%: Minute of the post. Example: 42.

%second%: Second of the post. Example: 45.

%author%: Name of the author of the post. Example: ashish.

The values generated from the tags above are sanitized version of the post name, category name etc. For example: If your category name is Articles and Updates, the sanitized version for permalinks is: articles-and-updates.

You can change sanitized URLs for categories by going to Posts > Categories in WordPress admin. Then edit a category and change its Slug. The same option is available for tags as well. You can also input a slug while creating a new category. Post slugs on the other hand can also be manually entered while creating a new post.

Changing or Removing Category and Tag Base

By default WordPress sets a base for categories and tag. The default values are “category” and “tag”.

By Default:
Category page permalink: http://www.WordPressBlog.com/category/category-name/
Tag name permalink: http://www.WordPressBlog.com/tag/tag-name

You can change category base from the Permalinks Settings page by inputting a category base and a tag base.

category-tag-base

To remove category base use the plugin: WP No Category Base.
To remove tag base: WP No Tag Base.

Permalinks for Pages, Categories and Tags

Permalinks for WordPress pages, categories and tags are not highly configurable as it is for posts. If you update the post permalink to include the postname, the permalinks for your other WordPress content are set as

Page: http://www.WordPressBlog.com/page-name/
Category: http://www.WordPressBlog.com/category-name/
Tags: http://www.WordPressBlog.com/tag-name/

You can edit the slug while creating a new page or category and that is it. For tags, you can edit the slugs after the tags are created. Configuring this is normally not required as you have only a few pages and categories. The default structure works quite well.