WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:


but now it is located here:


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
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

Your Answer


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.