WordPress Find and Replace String

by Nish Vamadevan on 13/06/2009 · 0 comments

I had to do a find and replace a string on all of the wordpress post. This can only be done via a MySQL query and won’t take more than a minute.

This is how it’s done. In the following example, I will be finding X and replacing it with Y

The string will find X in every single post and replace it with Y. This also works with phrases, URLs etc..

update wp_posts set post_content = replace(post_content, 'X', 'Y')

Leave a Comment

 

Previous post:

Next post: