Return to Snippet

Revision: 34733
at October 27, 2010 21:11 by suibhne


Initial Code
update wp_posts set post_content = replace(post_content, 'http://www.TESTDOMAIN.com', 'http://www.LIVEDOMAIN.com')

Initial URL


Initial Description
This is a simple SQL statement which will update all the posts within a Wordpress installation changing the domain which files were uploaded to. 

Very handy if migrating a site from a test to live environment and all embedded images are referenced using the test url.

Initial Title
Update File Upload Domain in Wordpress Posts

Initial Tags
mysql, wordpress

Initial Language
SQL