I don’t know why this feature isn’t built into WordPress. It’s one we’ve desperately needed since the beginning, so when I first discovered the Find and Replace plugin, I just about threw a party. (And when I installed it I noticed that one of the developers is someone I know from the WordPress LinkedIn group.)
The plugin lets you search through posts, pages, and trash, and replace one string with another. It’s very handy for those occasions when you’ve relocated a blog and need to change a URL everywhere it appears, or your database import has left you with gibberish for all your curly quotes. Yes, you can go in and fix these things with phpMyAdmin, if you know something about database management—ugh. Or you can go in and make the fixes manually. Double ugh. I’ve done it. This is much, much easier.
For instance, I just noticed that I had a wildly outdated wp-config.php file for the Reports from the Asylum blog/podcast. When I switched over to the latest version of that file, my special characters all went to hell. I installed this plugin and fixed them.
Step 1: Copy gibberish code and paste into the “search string” box.
Step 2: Put appropriate HTML code for the special character (e.g. “ for “ or — for —) into the “replace string” box
Step 3: Select the appropriate choice (post, page, trash, post page and trash) from the drop-down menu
Step 4: Click the “search and replace” button.
You’ll get a message saying that the replacements will be made when resources are available, but in my experience, it was immediate.
Because there’s no option to confirm each replacement (the way there is in, say, Microsoft Word), you want to be very sure that the string you’re replacing is unique. URLs and gibberish code are good candidates. So is HTML, if, for instance, you wanted to switch all your <i> to <em>.
Not everyone will need this, but if you do need it, it will save you hours.
Leave a Reply