Permalinks
June 30, 2008 – 12:00 pmFrom Wordpress:
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. (From Wordpress Permalinks)
This is enough of a reason to make sure that you are using permalinks and not wordpress’s default linking structure (yourdomain.com/?p=100 — which means post 100). Another really good reason to make sure that you use permalinks is for Search Engine Optimization (SEO) purposes. Any bit of information that can be used to rank your site will be, including your url. If you url can include information about the page, in this case the post title, it will help your page rank for those keywords.
Breaking Down the Permalink
I’ll break down the permalink structure. The URL for this article that you are reading is:
http://www.wp-relief.com/13/2008/06/23/permalinks/
Base url: http://www.wp-relief.com/ - this is the domain name of this site.
Post ID: /13/ - this is the auto-incremented ID that Wordpress gives to posts, as they are created.
Date of Post: /2008/06/23/ - The publish date of the article
Name of Post: /permalinks/ - The post title changed to all lowercase, with spaces replaced with “_”. Another example of this is /installing-wordpress-to-your-server/.
How to set up your permalinks
If you login to wordpress, and go to “Settings”, then “Permalinks” you will see options for managing your permalinks. It should look similar to this:
The first section on this page will allow you to choose how you want your permalinks to be created. Once you make your decision and hit the update button, your permalinks will be recreated. My suggestion is to make the decision as to how you want your permalinks to be created as soon as possible in your blog’s life. The reason is that search engines will have the original link and the content on that page associated with your keywords. If you change the link, you are effectively removing that page from the search engines. The other problem you could have, is that if a search engine pulls up the page using the new permalink before the old one is de-listed, then you could get in trouble for having duplicate content. Search Engines are smart, but they don’t know that you changed your permalink structure, so they assume that every new URL they come across from your site is a new page.
Custom Settings: You can customize the links for posts on your site by choosing one of the pre-defined settings, or a custom built setting.
The tags that you can use to formulate your permalinks are:
- %year%
- The year of the post, four digits, for example 2004
- %monthnum%
- Month of the year, for example 05
- %day%
- Day of the month, for example 28
- %hour%
- Hour of the day, for example 15
- %minute%
- Minute of the hour, for example 43
- %second%
- Second of the minute, for example 33
- %postname%
- A sanitized version of the title of the post (post slug field on Edit Post/Page panel). So “This Is A Great Post!” becomes this-is-a-great-post in the URI (see Using only %postname%)
- %post_id%
- The unique ID # of the post, for example 423
- %category%
- A sanitized version of the category name (category slug field on New/Edit Category panel). Nested sub-categories appear as nested directories in the URI.
- %author%
- A sanitized version of the author name.
- This information comes from WordPress’ Permalinks Page.
The main idea that you HAVE to make sure you remember about a custom permalink structure is that you want every post URL to be different. This is easily accomplished by making sure that you:
end your structure with either %post_id% or %postname% (e.g. /%year%/%monthnum%/%day%/%postname%/) so that each permalink points to an individual post.
This information comes from WordPress’ Permalinks Page.
Optional: This area lets you customize the base “folder” that will be in your links to categories and tags. There is a good example on the admin page for how to use this feature:
If you like, you may enter custom structures for your category and tag URLs here. For example, using /topics/ as your category base would make your category links like http://example.org/topics/uncategorized/. If you leave these blank the defaults will be used.
Save your changes and check the front-side of your blog, you will find that your permalinks have been updated for your posts and categories.
Suggested Permalink Structure
The most basic permalink structure that I suggest you use for a regular blog is:
/%year%/%monthnum%/%day%/%postname%/
This permalink structure will almost guarantee different links for every post unless you post the same name post on the same day. If this happens, WordPress will automatically append a number to the end of the %postname%.
There are more ideal permalinks for specific instances. For example: If you are a news site and you want to be included into Google News, you have to use a three digit unique id in every post. This is easily done with the %post_id% variable from above. And you can put it anywhere in the permalink, I suggest at the beginning. So your permalink would look like this:
/%post_id%/%year%/%monthnum%/%day%/%postname%/
Next Article: Choosing Your Theme
Sphere: Related Content
1 Trackback(s)
You must be logged in to post a comment.