Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm going to move my site from development/staging environment (i.e. dev.example.com) to production environment (example.com).

Probably, existing links in my pages and posts will still point to the old url, i.e. dev.example.com. how do i deal with this issue? is it possible correct all the links in one go? any suggestions?

thanks!

share|improve this question
add comment

2 Answers 2

See Moving WordPress « WordPress Codex

These are typical queries to run in phpmyadmin to change URLs, but you may also have serialized data in widget and theme options that will have to be changed, too:

UPDATE wp_options SET option_value = replace(option_value, 'http://olddomain.com', 'http://newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET guid = replace(guid, 'http://olddomain.com','http://newdomain.com');

UPDATE wp_posts SET post_content = replace(post_content, 'http://olddomain.com', 'http://newdomain.com');

UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com');

And Search RegEx is a good plugin to be able to search and replace with Grep through all posts and pages to check if any URLs were missed.

share|improve this answer
    
Changing the GUID will cause feed readers to republish old content. The GUID is just an identifier for feed readers and is supposed to be unique. For most sites, its unnecessary to change it and for sites that have people subscribing to feeds its important not to. –  Elpie Jun 7 '11 at 13:01
add comment

What I do is make a dump of the database and then Search / Replace what I need either with a text editor if the DB is rather small (Geany is great for that) or if it's a big DB I use Regexxer Search Tool.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.