Update: This is an old archived post on this site and is only kept online for my own archival purposes. The content and images on this post this might be outdated and incomplete. Please do not sue me if the Internet breaks because you read this.
It has been one of those things you knew you had to do but was near the bottom of your very long to-do list. But after a few days of thinking it over and browsing the web and eventually looking for the right plugins, I managed to migrate my permalink structure to a more keyword rich, SEO friendly layout.
My old permalink structure was the date based /%year%/%monthnum%/%day%/%postname%/ which I still find to be useful for proper chronological organization of one’s journal or news items but I also find my new permalink structure /%category%/%postname%/ to be more keyword rich and easier for both humans and bots.
I am now using Permalink Redirect by Scott Yang to help me simplify the process of migrating permalinks. The plugin worked like a charm. I tested how the plugin would handle backlinks using the old permalink structure and everything redirected properly to the new permalink structure without any noticeable delay.
There was only one problem I encountered while migrating my permalink structure and that was which category name will be used. By default, WordPress would use the category name with the lowest ID if incase you have multiple categories per post. My theme makes use of different categories as well as some temporary categories which I use as a switch to place posts on the four special feature sections of my theme.
The answer to this minor problem was sCategory Permalink, a plugin by Dmytro Shteflyuk which allows you to tick which category your post will use for your permalink structure. It works by making use of a custom permalink option %scategory%(take note of the extra “s” before the category word).
There is Always a Better Way
What I really wanted was to somehow write a few lines of code on my vhost file on Nginx so redirection would be done on the webserver and not through PHP. For me this is the ideal setup as it puts less load on your server. I also have enough documentation to configure this for Apache but not for Nginx. The next few days were spent looking around for answers, which included several forum postings and reading a lot of Nginx documentation. I gave up after a week so I was left with the plugin option instead but still open to learning how to do it through Nginx but for now I would settle for the plugin.
A person’s quest for knowledge can only be limited by himself and not by anything else. For now this setup works well for me but I know there is better way of doing things.
Other Related Articles
Migrating your WordPress Permalinks Structure by Michael Aulia