Advertisement

How to Customize Permalinks on Your WordPress Blog

Each WordPress blog post is assigned its own Web page, and the address (or URL) of that page is called a permalink. WordPress lets you customize your permalinks to make them more attractive and, ultimately, more pleasing to search-engine spiders.

Posts that you see in WordPress blogs usually have the post permalink in four typical areas:

  • The title of the blog post

  • The Comments link below the post

  • A Permalink link that appears (in most themes) below the post

  • The titles of posts appearing in a Recent Posts sidebar

Other bloggers can use a post permalink to refer to that particular blog post. So ideally, the permalink of a post never changes. WordPress creates the permalinkautomatically when you publish a new post.

By default, a blog post permalink in WordPress looks like this:

WordPress, however, lets you take your permalinks to the beauty salon for a bit of makeover so you can create pretty permalinks.

Pretty permalinks look something like this:

http://yourdomain.com/2008/01/01/pretty-permalinks/

Break down that URL, and you see the date when the post was made, in year/month/day format. You also see the topic of the post.

To choose how your permalinks look, click Permalinks in the Settings menu and choose from these options:

The Permalink Settings page includes options for customizing your permalinks.
The Permalink Settings page includes options for customizing your permalinks.
  • Default (ugly permalinks): WordPress assigns an ID number to each blog post and creates the URL in this format:

  • http://yourdomain.com/?p=100

  • Day and Name (pretty permalinks): For each post, WordPress generates a permalink URL that includes the year, month, day, and post slug/title:

    http://yourdomain.com/2008/01/01/sample-post/

  • Month and Name (also pretty permalinks): For each post, WordPress generates a permalink URL that includes the year, month, and post slug/title:

    http://yourdomain.com/2008/01/sample-post/

  • Numeric (not so pretty): WordPress assigns a numerical value to the permalink. The URL is created in this format: http://yourdomain.

    com/archives/123

  • *Custom Structure: WordPress creates permalinks in the format you choose. You can create a custom permalink structure by using tags or variables.

A custom permalink structure is one that lets you define which variables you want to see in your permalinks by using the tags shown in the table.

If you want your permalink to show the year, month, day, category, and post name, you’d select the Custom Structure radio button in the Customize Permalink Structure page and type the following tags in the Custom Structure text box:

Permalink Tag Results
%year% 4-digit year (such as 2007)
%monthnum% 2-digit month (such as 02 for February)
%day% 2-digit day (such as 30)
%hour% 2-digit hour of the day (such as 15 for 3 p.m.)
%minute% 2-digit minute (such as 45)
%second% 2-digit second (such as 10)
%postname% Text — usually, the post name — separated by hyphens
%post_id% The unique numerical ID of the post (such as 344)
%category% The text of the category name that you filed the post in
%author% The text of the post author’s name (such as lisa-sabinwilson)

Be sure to include the slashes before tags, between tags, and at the very end of the string of tags.

Changing the structure of your permalinks in the future affects the permalinks for all the posts on your blog . . . new and old. Keep this fact in mind if you ever decide to change the permalink structure. An especially important reason: Search engines (such as Google and Yahoo!) index the posts on your site by their permalinks, so changing the permalink structure makes all those indexed links obsolete.

Don’t forget to click the Save Changes button at the bottom of the Customize Permalink Structure page; otherwise your permalink changes aren’t saved!

blog comments powered by Disqus
Advertisement
Advertisement

Inside Dummies.com