memo: change wordpress domain name

If you want to move a installation to a new domain these commands are necessary to bring the database up to speed with the domain name change:

UPDATE wp_options SET option_value = replace(option_value, 'http://old', 'http://new');

UPDATE wp_posts SET guid = replace(guid, 'http://old','http://new);

UPDATE wp_posts SET post_content = replace(post_content, 'http://old', 'http://new');

This is only for domain name change, if you are also moving to a different host then more db manipulation is necessary, like for example changing the upload_path option in the wp_options.

Kudos for this tip.

4 thoughts on “memo: change wordpress domain name

Leave a Reply

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

You are commenting using your 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