Posted on

Change url to all the site in mysql

use database;

— SET SQL_SAFE_UPDATES=0;  //if is myworkbench

update wp_options
set option_value=replace(option_value,”previous_url”,”new_url”)
where option_value like “%previous_url%”;

update wp_posts
set guid=replace(guid,”previous_url”,”new_url”)
where guid like “%previous_url%”;

update wp_postmeta
set meta_value=replace(meta_value,”previous_url”,”new_url”)
where meta_value like “%previous_url%”;

Advertisements

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