How to change your WordPress Permalink Structure • Yoast

Changing WordPress Permalink Structure

There are two steps in changing your WordPress permalink structure. The first is simple, go to Settings -> Permalinks and select Post name.

If you don’t have the post name option yet, you’re not on WordPress 3.3, the release of which is imminent. You could wait a bit for the update, or you could just add /%postname%/ as a custom permalink structure.

The second step is to redirect your old permalinks to your new ones. To do that, you have to add redirects to your .htaccess file.

In my domain the redirects is like:

  • Day and Name /%year%/%monthnum%/%day%/%postname%/ :  RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)$$4
  • Month and Name /%year%/%monthnum%/%postname%/ : RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/(.*)$$3
  • Numeric /archives/%post_id% :  RedirectMatch 301 ^/archives/(\d+)$$1
  • Default ?p=123 : You don’t have to do any redirects, WordPress will do it for you.


And if you wordpress work in subdirectory redirects like :
RedirectMatch 301 ^/blog/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)$$4

via How to change your WordPress Permalink Structure • Yoast.

Leave a comment

Leave a Reply