As its GitHub documentation notes, the single-file PHP script searchreplacedb2 is “not terribly pretty, but it’s portable and it solves an important problem that comes up whenever WordPress sites get renamed.”

I’ll go further: There have been times when I couldn’t have done my job without searchreplacedb2, or at least something that does exactly what it does.

What it does is: it lets you rewrite any one value in your entire WordPress database to another value. This is most common for rewriting URLs during a site migration—for example, from to

searchreplacedb2 dials down migrating WordPress databases one notch, from horrifying to merely frustrating, and that’s made all the difference. As a last note, though, don’t use it if you don’t know what you’re doing: it certainly does give you the tools to full-on destroy an entire database if you do your rewrites thoughtlessly. (And don’t forget to remove it when you’re done, for the same reason.)

Add a Comment

Your email address will not be published.