≡ Menu

WordPress Find and Replace String

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')

Next post:

Previous post:

Copyright © Nish Vamadevan 2002-2019. All Rights Reserved. Terms and Policies.