DISCLAIMER: this post is older than one year and may not be up to date with latest WordPress version.

If you use the ugly /%year%/%monthnum%/%day%/%postname%/ permalink structure, you should be interested to know how you can switch to the elegant /%postname%/ structure without loosing any backlink, using a simple .htaccess redirection.

The first thing to do is to login to your WordPress admin, go to Settings → Permalinks and select custom. Fill out the field with /%postname%/.
Your permalinks will now look like the ones on this blog:


Now we got to redirect all backlinks using the old permalinks structure to the new permalink structure. To do so, you’ll have to edit the .htaccess file, located in WordPress root directory.
Be careful while editing .htaccess: Always create a backup before!

Paste the following line in your .htaccess:

RedirectMatch 301 /([0-9]+)/([0-9]+)/([0-9]+)/(.*)$ http://www.domain.com/$4

Allright! You just changed your permalinks structure without loosing any backlinks!

Credits goes to Joost de Valk newsletter for this awesome recipe!


  1. Thanks a ton buddy. You saved me a day !

  2. Just tried this out and it breaks the upload links as well….. If you have your uploads organised into year and month folders, this htaccess rule will break them too!!

Leave a Comment

Your email address will not be published. Required fields are marked *