WordPress category names and SEO: fixing a typo

The problem

So you’ve made a typo in your WordPress category.

It’s easy to log in to your WordPress administration site and correct the category name, right?

Yep, but that’s only half the job done; any existing external links to posts in that category will still have the old incorrect category in the URL, and will now return a 404 error, i.e. the links will now be broken.

The solution

What you need to do is create a redirect from the old incorrectly spelled URL to the nice new one.
To create this redirect you’ll need to be able to modify your site’s .htaccess file (NB: this only works for Apache web servers).
You’ll find it in the root folder of your site. You can access it via FTP, or through your web host’s administration interface, if you have one.

So, once you’ve got it open, you’ll see some existing rules: you can ignore these.

Look for this section:

<IfModule mod_rewrite.c>
RewriteEngine On

... (some other stuff here)

</IfModule>

If it doesn’t exist, you’ll need to add it.

Between the <IfModule> tags, append the following line:

Redirect 301 /rwong http://yoursite.com/wrong

…and when you save your .htaccess file, your old incorrect URLs should still work!

The explanation

Let’s break down each part of this new line:

Redirect

This is a directive for your web server; it tells it what to do with what comes next.

301

This is the type of redirect to execute. A ‘301’ is a permanent redirect – this tells Google (and anyone else) that this resource had moved permanently. (Here’s a list of HTTP status codes for your reference.)

/rwong

This string is the trigger for the redirect, i.e. the incorrectly spelled part of your URL.

http://yoursite.com/wrong

…and this is the correct URL to redirect to.

In conclusion

So to wrap it all up, you should have something that looks like this:

<IfModule mod_rewrite.c>
RewriteEngine On

... (some other stuff here)

Redirect 301 /rwong http://yoursite.com/wrong
</IfModule>

I hope you might find this useful.
Please comment if you’ve got something to ask, something to add or if you know of a better way to do this.

This entry was posted in Coding, Search Engineering, Wordpress. Bookmark the permalink.

3 Responses to WordPress category names and SEO: fixing a typo

  1. Mike says:

    Great information you are providing but seo is complicate, why not outsource it here: http://www.youtechno.info/2009/01/service-upgrade-better-seo-for-your.html

  2. Dan says:

    Mike,

    SEO is dead simple.

    And note that my site homepage has a Google PageRank of 5, whilst your homepage has a PageRank of 0.

  3. Dudelka says:

    At me precisely same problem

Leave a Reply

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