Batch replace string in WordPress posts


I want to change a link, from text link to image link,

<a href=””>download</a>
<a href=””><img src=”/images/download.gif” alt=”download” /></a>

And this link is not in one post, but some posts, it will spend a lot of time if I replace it one post by one.

I tried WordPress Exporter/Importer, but do not work, I get a doubled menu, it’s not my wanted.
I think it should be “Export Posts” -> “Delete All Posts” -> “Replace Posts” -> “Import Posts”.
And I think it will change Post ID, No, I just want to update the post contents.

So I need use some tools to do it.

First, I use MyLobEditor ( to export from WordPress posts (Mysql database) to files.

“Export LOB”

MyLobEditor Export WordPress

Then, I use Windows Grep ( to batch replace text in files.

Last, I use MyLobEditor to import files to WordPress (Mysql database).

“Import LOB”

MyLobEditor Import WordPress

Note: Do not check “Use Unicode” box in MyLobEditor logon form.