If you have just set up a WordPress blog, and want to change your permalink structure from the ugly and non-descriptive permalinks such as http://yourdomain.com/?p=1 and http://yourdomain.com/?page_id=2 to nice looking URL’s, read on. In this tutorial we’ll go over:
- Where to customize your permalink structure in your WordPress admin pane.
- Date and name based permalinks
- Numeric based permalinks
- How to make your own custom permalink structure
Pretty soon you’ll have SEO-friendly and descriptive URL’s for your WordPress site.
Part 1: Where to go
Built in with every WordPress installation is a menu to customize your permalink structure. Simply go to the Options menu and select the Permalinks tab. Your screen should look something like this:
At this screen, it should be fairly self-explanatory to choose some of the predefined permalink options. Theme Lab actually uses the Date and name based option, which you can see in the URL right now. The numeric based permalinks will simply take your post ID number, and append it to the URL.
These permalink options require your .htaccess file to be writable. If it’s not, WordPress will generate the code you need to copy manually into your .htaccess file to enable the mod_rewrite capabilities. You’ll have to create a file called .htaccess in your WordPress root directory if it doesn’t exist already.
Part 2: Customize your permalinks
This will take you beyond some of the predefined options within the permalinks menu. As outlined on this page in the WordPress Codex, there are a number of tags available to customize your permalinks even further. In addition to %year%, %monthnum%, %day%, %postname%, and %post_id% — you can use:
- %hour% - The hour of the time stamp of your post (1-24)
- %minute% - The minute of the time stamp of your post (1-60)
- %second% - The second of the time stamp of your post (1-60)
- %category% - The category slug (wordpress-tutorials)
- %author% - The author’s name (Leland)
For our example, let’s just choose to have Date and name based permalinks. If your .htaccess is writable, you should get the following message.
When you’re done, you should have the exact same link structure as used here on Theme Lab. These links are known to help with search engine optimizations, much more desirable than the old ugly URL’s (/?p=1 and ?page_id=2). If you liked this tutorial, feel free to comment and share! Also feel free to subscribe to our Feed









March 11th, 2008 at 11:08 pm
Thanks for the tips. Your notes are very clear and easy to follow.
Nick
March 12th, 2008 at 11:23 am
No problem, glad you liked it.
April 10th, 2008 at 6:49 pm
thanks for the info, I manage to complete the first step( changing my permalink Date and Name option, however, I dont know how to create .htaccess, should I open the cpanel and create a folder for that(in my public html)?
thank you
April 10th, 2008 at 8:05 pm
Does WordPress not create an .htaccess automatically? If not, you need to create a blank one in your WordPress root directory and set the permissions to 666 so it can write to it.
April 10th, 2008 at 11:58 pm
Yes, it does..thanks, I just checked it few minutes ago in my filezilla. Thanks,it is a great help, anyway for my additional info, what do you mean by set the permissions to 666?
I will backlink you on my website so that others can learn as well from you.
April 11th, 2008 at 12:00 am
If the .htaccess wasn’t writable, you would’ve had to set the permissions to 666 for it to work on your host…but I guess you won’t have to worry about that. Thanks!
April 21st, 2008 at 12:42 am
I’ve been looking into changing my permalinks from the default ugly http://yourdomain.com/?p=1 to something else. Then I noticed that some newspapers(but not all) websites don’t use descriptions in their url’s but complex page numbering system. eg :
http://www.news.com.au/perthnow/story/0,21598,23403365-5005364,00.html
or:
http://www.straitstimes.com/Latest%2BNews/Asia/STIStory_229547.html
Is there a case for keeping the old ugly method, on the basis, that it make no difference at all. Why are these newspapers opting to use this method? Infact the ugly url is shorter and simpler for wordpress. Any thoughts?