Feature
Post

Category
Code


Permalink Issues When Moving from Typepad to WordPress

So, you have finally decided to take the plunge and move from Typepad, a hosted service, to WordPress’ self-hosted solution, but you don’t want to lose your permalinks that everyone has linked to?

See, when you export from Typepad it doesn’t keep your post slugs intact, so WordPress generates some of its own, based on the title of the post. This means the URL you had before is no longer correct. Firstly, Typepad added a .html on all of your post related links. WordPress doesn’t do this by default.

To change this, all you need to do is go to the Options -> Permalinks section, and select date and name based. In the custom box, it will fill in:
/%year%/%monthnum%/%day%/%postname%/

From here, change the ending to:
/%year%/%monthnum%/%day%/%postname%.html

This should now make your permalinks to your posts similar to your TypePad settings you had, but with one glaring difference. TypePad truncates the link to fifteen characters, while WordPress allows you up to two hundred characters. This is an important difference when your post title is something like “Permalink Issues When Moving from Typepad to WordPress”.

In TypePad that would be shortened to:
permalink-issue.html

Whereas in WordPress it would be:
permalink-issues-when-moving-from-typepad-to-wordpress

To fix this issue, there are many different things you can do. I have seen tutorials that require some complex, though interesting SQL queries that unfortunately don’t always work for the non-programmer/SQL expert.

Here is an example from Mo Jebus:
UPDATE _posts SET post_name = INSERT( INSERT(post_name, LOCATE('.html', post_name), 5, ''), 1, 9, '' ) WHERE 1

When I read this, I scratched my head. Surely, there must be an easier way to truncate the post slugs in WordPress to be fifteen characters, thus fixing most, if not all, of the permalinks so any links to the posts you once had, are still valid.

What about altering the table, so that the post_name, which is where WordPress generates its permalinks, is no longer than fifteen characters long? I then used an SQL query in phpMyAdmin to alter the table and shorten the post_name which worked perfectly for Sarah in Tampa, the site I was working on. Once we completed the first query, we re-ran it again, changing the field back to WordPress standard.

Here’s what I used:
ALTER table wp_posts modify post_name varchar(15)

After which I then changed it back by running:
ALTER table wp_posts modify post_name varchar(200)

That was it. Sarah had her permalinks the same as they were on Typepad, and so anyone clicking an external link should be brought to the correct post on her new WordPress powered blog.


  1. By Stephane posted on March 5, 2008 at 7:04 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    Nice find David!

    One thing though…Prior to June 2007, Typepad was using “underscore” as a word delimiter. That has been changed to “-”, but all posts prior to June 2007 will still have “_”…

    Any thoughts on how this can be solved? Some sort of find and replace?

  2. By Stephane posted on March 5, 2008 at 7:07 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    One other thing… is the images. Moving the images out of Typepad and in WordPress is a challenge as well!

  3. By Alec posted on July 17, 2009 at 9:34 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    Cool methodology David.

    For us (and we do a lot of Typepad to WordPress moves) we found the best way to do it is to grab the actual Typepad URLs as fixed fields and import them with the posts themselves (sometimes you change the URL in Typepad as well and as Stephane pointed out, SixApart did bounce the syntax around).

    To do that, you need to use upgrade to pro and use custom templates for the export. Downloadable templates in our Typepad to WordPress guide.

    The sad thing is SixApart deliberately cripples Typepad export as I found when I interviewed Anil Dash.

  4. Trackback