Plugin of the Week: Search and Replace

We ran across an interesting problem when we transferred a WordPress site from Dreamhost to Bluehost. We actually did a database export/import with phpMyAdmin instead of using the XML export tool built into WordPress.

When the database was transferred over to the new site, something had converted or rendered the apostrophe characters (‘) in the site to a weird character string: â€™

So we had this seemingly weird string appearing on different posts and pages.

So how could you fix this? One way would be to give the aptly named “Search and Replace” plugin a whirl. It worked really well for our site considering it replaced over 400 character errors – which would have taken a really long time to fix manually.

Once the Search and Replace plugin is installed and activated, you’ll find it under the Tools menu. Select the database field where you want to perform the search and replace. Most of the time this would be “content.” Make sure to scroll to the bottom of the page to use the search + replace function.

Search replace plugin

Make sure you have a backup of your the original MySQL file just in case you need to restore it because there isn’t an undo function. Again, there is no undo so be careful using this plugin.

Here are five other common conversion errors that we also had to fix.

• = bullet point •

— = long dash/hyphen —

“ = start quote “

” = end quote ”

’ = apostrophe '

Get it: “Search and Replace” plugin

Side note: If you’re an advanced user and want to prevent this error from happening, here’s a solution at the MySQL level.

4 Replies to “Plugin of the Week: Search and Replace”

  1. Noel: I’m interested in doing a little fix on several, but not posts, only. Can you control this thing to that specific a search?

    Sally E (not ready for the big time)

  2. The plugin has the option for “content” tables which means both posts and pages – (not sure if that includes widgets too?). Unfortunately there’s no preview and I don’t see a way for it to ask which ones you want to apply the changes to selectively. You might have better luck using PHPmyAdmin to run SQL queries to be more selective. Sorry I don’t have a better answer.

Leave a Reply to noel Cancel reply

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