How to Mysql search and replace find Query Worpress Post


update [table_name] set [field_name] =
replace([field_name],'[string_to_find]’,'[string_to_replace]’);

if you are moving your website to another domain its very usefull to replace hard coded urls with one click

example
UPDATE wp_posts SET post_content = REPLACE(post_content,
'oldwebsite.com', 'newwebsite.com');

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s