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 have just moved hosts, and with the move I've also changed the setup that I have for media uploads.

I used to host my media on a subdomain called media.detailsofmylife.net, but now that I have switched over, I want to go back to the traditional detailsofmylife.net/wp-content/uploads/ style. I have already backed up and relocated the content so it should be ready to go.

For example, yesterday, an image used to located here:

http://media.detailsofmylife.net/uploads/2013/06/Cyril-Hahn-Perfect-Form.jpg

but now it is located here:

http://www.detailsofmylife.net/wp-content/uploads/2013/06/Cyril-Hahn-Perfect-Form.jpg

Could someone please help me with the necessary SQL statement to correct all of the old url references to the new format?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Use a plugin like Deploy Helper. Essentially, it allows you to swap out all instances of one URL with another, and will also handle serialized data.

Just enter the old URL as media.detailsofmylife.net/uploads and the new one as www.detailsofmylife.net/wp-content/uploads.

Make sure you also reset your custom upload paths. If you'd defined constants like WP_CONTENT_URL or UPLOADS in your wp-config.php, remove them. Similarly, delete any possible settings in the database by loading wp-admin/options.php in your browser & emptying the values for upload_path & upload_url_path.

share|improve this answer
    
Thanks, that plugin worked great! –  Mark Spivey Jun 26 '13 at 12:13
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.