Replacing Text in a MySQL Table


After exporting/importing my Wordpress tables today I found that many of my posts contained a weird character strewn about. That character was the character ‘Â’.

A number of ideas how to remove this came to mind…I could try to find the problem in the original SQL, but I have had additional comments since the import so that option was effectively off the table.

A quick Google search led me to this helpful page.  In short, I had to run the following:

UPDATE wp_posts 
SET post_content = REPLACE(post_content, 'Â', '');

And that’s it. Be very careful as MySQL doesn’t give you good ways to rollback mistakes.

,

  1. No comments yet.
(will not be published)
  1. No trackbacks yet.