Truncated or Garbled Content

After importing from another site, you might find that some of your posts or pages are filled with garbage characters or inexplicably cut off. What happened?

The key to the problem is this line in your wp-config.php file:

Most likely, your old database used a different character set than your new one. Garbage characters can appear when the import script incorrectly translates the character sets. Your posts might also be truncated at the point where an unrecognized character appeared: a curly quote, an em dash, anything that might have been stored as text and not an encoded HTML equivalent.

There's no easy way to fix this once it's happened. If you don't think the truncation problem is widespread, find one of the truncated articles and take a look at the original version from your old database. Find the character that's causing the problem, and search your old site for it. For all the results you find, just copy the remainder of the article by hand. WordPress does know how to handle special characters, and will encode them correctly once you save your post or page.

If the problem is widespread, there's nothing to do but start over. Try to convert the original database's character set to the same one your WordPress database is using. (Make a backup first!) Then run your import again.

Was this article helpful?

0 0

Post a comment