How to Setup Your WordPress Permalink Structure to Look Good, Perform Well and be SEO Optimized
One of the first things you need to do after installing WordPress is to setup the permalink structure. While it is possible to change your permalink structure once your website is up and running, my goal with this article is to provide you with enough information so you can make the right decisions from the start. Trust me, it will make things much easier for you down the line. Don’t worry if your WordPress site is already up and running though. You still can, and may want to, change your permalink structure. I’ll cover all the steps necessary to make a WordPress permalink change the right way in a follow up article.
Let’s begin by looking at what exactly permalinks are. Permalinks, as defined by the WordPress.org documentation, are described as:
Permalinks are the permanent URLs to your individual weblog posts, as well as categories and other lists of weblog postings. A permalink is what another weblogger will use to link to your article (or section), or how you might send a link to your story in an e-mail message. The URL to each post should be permanent, and never change — hence permalink.
The default permalink structure for WordPress looks like this:
This format performs well, but it doesn’t look good or provide any useful information to your visitors or search engines. Now lets take a look at how to set your permalink structure so it also looks good…
WordPress Permalink Settings
Luckily, WordPress makes it easy for us to setup a custom URL structure through the Permalink Settings menu (Dashboard → Settings → Permalinks). You should see a screen that looks like this:
You’ll notice there are 4 different “common settings” listed on this screen. Personally, I like the middle two: “Day and name” and “Month and name”. Both of these perform well, and accurately describe the content. You’ll notice these two permalink structures on many of the top WordPress sites around (such TechCrunch, Smashing Magazine and Engadget). If you like one of these URL structures then just select the corresponding radio box, click the “Save Changes” button and you’re all set! Not quite sold? No worries, there’s also a text box at the bottom called “Custom Structure”.
How to Set Your Custom Permalink URL Structure
Once you select the “Custom Structure” option you’re able to enter anything you want. Well, not quite anything… There are a couple of important points to keep in mind when entering your custom permalink structure.
- You need to end your structure with either %post_id% or %postname%. This will ensure that each permalink points to an individual post.
- Performance. You should NOT begin your custom permalink structure with the category, tag, author, or postname fields. The reason is that these are all text fields, and using them at the beginning of your permalink structure will require WordPress to run more checks (and take more time) to distinguish your Post URLs from Page URLs. I won’t go into all the technical details here, but this is clearly stated in the WordPress Permalink Documentation, and there’s a great technical write up on this issue by Otto.
Update (5/24/11): Joost de Valk of Yoast pointed out a great workaround to avoid any performance hit: use a caching plugin such as W3 Total Cache. This plugin will allow you use a permalink structure starting with the category, tag, author, or postname fields and not lose any performance. Thanks to Joost for the great advice!
- Instead, select a structure that starts with a numeric field, such as the year or post ID.
That’s right, the permalink structure “/%category%/%postname%”, which is recommended on a number of SEO blogs is NOT good to use on your WordPress site. Sure it looks good for SEO purposes, but it will have a negative affect on your site’s performance. The same goes for just using just “%postname%”. A lot of people don’t realize site performance is actually one of the factors included in your search engine ranking (Matt Cutts confirmed this on his blog). That means using one of these permalink structures might look good, but it could actually have a negative affect on your SEO effort.
So what should you use? As long as you follow these rules, you can use the following variables in your custom permalink structure:
- %year% – The four digit year of the post (e.g. 2011)
- %monthnum% – The two digit month of the year (e.g. 01)
- %day% – Two digit day of the month (e.g. 15)
- %hour% – Two digit hour of the day (e.g. 20)
- %minute% – Two digit minute of the hour (e.g. 22)
- %second% – Two digit second of the minute (e.g. 40)
- %postname% – A cleaned up version of the title of the post. For example, “My First Blog Post!!” becomes “my-first-blog-post” in the URL. Do NOT start your permalinks with %postname% for performance reasons.
- %post_id% – The unique ID # of the post (e.g. 218)
- %category% – A cleaned up version of the category name (nested sub-categories will appear as nested directories in the URL). Do NOT start your permalinks with %category% for performance reasons.
- %tag% – A cleaned up version of the tag name. Do NOT start your permalinks with %tag% for performance reasons.
- %author% – A cleaned up version of the author name. Do NOT start your permalinks with %author% for performance reasons
Once you install WordPress you should put some thought into how you setup the permalink URL structure. Choosing the wrong structure can result in a lower search engine ranking and poor site performance. Taking the time to select the right permalink structure can help your site ranking and performance. It will also save you the trouble of having to change it in the future (which we’ll tackle in one of our next articles in case your site is already up and running and you do need to make a change).
8 Comments + Add Comment
Leave a comment
Welcome to All Webmaster!
Hi, my name is Dana and here at All Webmaster I teach people how to build websites. I've been creating websites professionally for over 12 years and this is where I'll share the things I've learned so you can build your own website and get people to visit it. [More about...]