WordPress Permalinks

WordPress Permalinks are the permanent URL’s to the individual posts, pages, as well as categories and other lists of the WordPress blog postings. It is called permalink because the URL to each post should be permanent, and never change — hence permalink.

Different web server use different modules for creating permalinks. Permalinks are available under:

  • Apache web server with the mod_rewrite module
  • Microsoft IIS 7+ web server with the URL Rewrite 1.1+ module and PHP 5 running as FastCGI
  • Microsoft IIS 6+ using ASAPI_Rewrite
  • Lighttpd using a 404 handler or mod_rewrite

Choosing your permalink structure

In the Settings → Permalinks panel (Options → Permalinks before WordPress 2.5), you can choose one of the “common” structures or enter your own in the “Custom structure” field using the structure tags.

Please note: You never, ever put your site url in the permalinks slot. You must use one of the structure tags, or a combination of tags only. To activate PATHINFO permalinks, start your permalink structure with index.php/.

permalink-settings

Structure Tags :

You can use these tags to customize your “Pretty” or “Almost Pretty” permalinks.  Make sure to end your structure with either %post_id% or %postname% (e.g. /%year%/%monthnum%/%day%/%postname%/) so that each permalink points to an individual post.

Following is the list of the structure tags:

  •  %year%  : The year of the post, four digits, for example 2013
  •  %monthnum%  :  Month of the year, for example 03
  • %day% : Day of the month, for example 15
  • %hour% : Hour of the day, for example 16
  • %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. 

Category base and Tag base

The Category base and Tag base are prefixes used in URLs for category and tag archives, which look like this:

  • example.net/wp/category_base/category_name
  • example.net/wp/tag_base/tag_name 

The default values for these are category and tag. You can change them, but you can’t remove them from the URLs altogether. Custom permalinks work on most systems without any problems, but there are still some conditions where problems occur.