How do I modify the url of uploaded media content?

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.

Read More

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?

Related posts

1 comment

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

Comments are closed.