Recently, we ran across a forum where an interesting scenario was listed that dealt with updating URL’s during transition from temporary domain (or subdomain) to live site. In this particular case, the temporary site had photos with the WordPress URL and Site address URL’s defined using the temporary subdomain. So, when the photos or PDF’s are embedded to a post or a page, the temporary domain goes with it. They were concerned about having to change a lot of URL’s during the change yet didn’t want to maintain the development URL long term.
Matthew Muro, Web Developer with the UA Office of Web Communications gives us this simple advice:
Here’s the simplest SQL statement you need to run, to reflect the production/live URL.
UPDATE wp_posts SET post_content = REPLACE (post_content, ‘http://exampleoldsiteurl.com’, http://examplenewsiteurl.com’)
There is also a Codex page that describes how to change the URL: http://codex.wordpress.org/Changing_The_Site_URL.
We’ll have this in AutoPress soon as well.
Does this work with URL’s inside a serialized array too? Without breaking it, for example when the length of the URL differs.