Search and replace is never fun. Being a former programmer, I’ve always hated it — editors are not smart they don’t know what you mean and act literally. Now that’s a text file – how do you go about searching and replacing blog posts in a database that may be 100mb in size!!!
It’s not an easy task. But thankfully, someone thought of that.
Then I switched to the latest version if WordPress and switched to a new theme that was narrower than the previous one I had a dilema. My graphic signatures were too long! Aaaack! What is a former programmer and IT guru to do?
I dug down and started playing with PHPMyAdmin and writing up MySQL statements. Ugggh. Not fun. I love IT, but I don’t want to have to do the grunt work anymore – unless it’s something that I’m passionate about, then I’ll get my hands dirty.
So while the code isn’t too complex:
UPDATE wp_posts SET post_content = REPLACE (
‘Item to replace here’,
‘Replacement text here’);
I’m thinking to myself – sure this is one time change… or is it? I don’t want to have to be writing SQL statements all the time.
Solution – PLUGIN! Luckily WordPress has thousands of plugins out there, and I found an ideal plug-in.
Pop into the PLUGINS box on your WordPress install (2.8 or higher) and click on the ADD NEW menu item. Then search for the plug-in you want.
You can even install directly from that screen.
I picked the first one in the list written by Frank Bultge – http://bueltge.de/wp-suchen-und-ersetzen-de-plugin/114/ and installed it and activated it.
The only thing I found goofy is that I have to go back to the PLUGIN page to use the plug-in. But that’s minor.
Click on SETTINGS and you are ready to start.
First select which areas of the WP database you want to search.
Next – enter the old text in REPLACE and the NEW text in WITH.
Finally cross your fingers, say a prayer and hit GO!
Within seconds the search and replace should be completed.
…I am joking about the prayer. But you should back-up your database, just in case!
That was simple. I don’t need to mess around with SQL statements and since many bloggers may not be technically savvy to mess with SQL this plug-in is a great way to take care of your blog without having to spend hours learning something new when you may only use it a few times.