Changing your WordPress Permalinks

In this post we’ll walk through changing permalink settings on a new WordPress Installation and how to do 301 redirects when changing permalink settings on an established site.

Changing Permalink Settings on a New WordPress Installation

One of the first things to do when you login to your newly installed WordPress dashboard is to adjust the permalink settings to set the url structure for the site. You can do this by going to the Settings → Permalinks panel.

The default permalink setting for WordPress create ugly urls p=123 using the postid number. Changing to one of the date structures isn’t much better. The best option from an SEO perspective is to choose postname to put the title of your post in the url or, what I like to do, select Custom Structure and put /%category%/%postname%/ to add the category as well as the post title in the url. I then make sure I use keywords for category names.

Customize each Page/Post Permalink

Once you’ve saved the permalink settings you can see this in action as you customize the permalinks for each page and customize the permalink for every post you publish. Go to Posts → Add New… now type a title for your post. Right below the post title you’ll see the Post Permalink. The full title of the post will now be in the url. This probably means that some of your posts will have long titles.

Here’s the url for this post dandelionwebdesign.com/wordpress/ that’s the category and then WordPress adds the post title /changing-your-…ess-permalinks/. As the title was too long for the permalink “…” was inserted. I’ve edited the permalink to dandelionwebdesign.com/wordpress/changing-permalinks. I already have WordPress in my url from the category name so I don’t need to repeat it.

When you edit page & post permalinks keep them short, use keywords, stick to lowercase and use dashes to separate the keywords not spaces. Search engines recognize separators.

Should I Change Permalinks on an established site?

permalink-redirectI’m often asked about changing permalinks on an existing site. The worry is that changing the permalinks will create broken links impacting the traffic that you already have sending visitors to a 404 error page. The answer is YES I would recommend changing your permalink structure even if you have an established site BUT make sure you read on…

If you are running WordPress with the default ?p=123 structure you don’t have to worry. Go ahead and change your permalinks. WordPress will automatically forward to the new structure.

301 Redirect to Your New Permalinks

If you’re using one of the date or the numeric permalink structure options you’ll need to redirect your old permalinks to your new ones. There are a number or WordPress Permalink Migration plugins available but I’ve yet to find one that isn’t broken. Instead of relying on a plugin add redirects to your .htaccess file.

If your structure is

  • Day and Name /%year%/%monthnum%/%day%/%postname%/ your redirect should be RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)$ http://yourdomain.com/$4
  • Month and Name /%year%/%monthnum%/%postname%/ your redirect should be RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/(.*)$ http://yourdomain.com/$3
  • Numeric /archives/%post_id% your redirect should be
    RedirectMatch 301 ^/archives/(\d+)$ http://yourdomain.com/?p=$1
  • Postname and you want to switch to a custom structure of /%category%/%postname%/ there is no way to redirect with .htaccess

You can also use the WordPress Permalink Generator by Yoast to generate the redirect code needed.

Copy the redirect code provided and paste it into the top of your .htaccess file.

If you are just needing to redirect one page to a new structure put this in your .htaccess file

redirect 301 /old/old.htm http://www.you.com/new.htm

  • replace /old/old.htm with your old url. Do not include http or www. Include the full path from the top level of your site to the page
  • replace http://www.you.com/new.htm with the full path including http://www to your new page

It should work like a charm.

Related posts:

  1. SEO for WordPress – WordCamp Toronto 2011
  2. WP-admin an Introduction
  3. Best WordPress SEO Plugins
  4. WP-admin Lesson 2: Writing Your first Post
  5. WP-admin Lesson 3: Pages

About Ruth Maude

Thanks for stopping by to read my blog. My name is Ruth Maude, a Toronto Web Designer. I blog mainly about WordPress, my favourite platform, SEO (search engine optimization) and about social media. Look for a new post on Monday morning. I appreciate your feedback, please add comments.

2 Responses to Changing your WordPress Permalinks

  1. This is so informative, as one of my clients has the date and post name in her permalinks, but would like to drop the dates, and I wasn’t sure how that would affect things. Thanks!
    Janet Barclay recently posted..Professional Organizers Blog Carnival for May 2012: Organizing for Families

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv badge