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?
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 aswww.detailsofmylife.net/wp-content/uploads
.Make sure you also reset your custom upload paths. If you’d defined constants like
WP_CONTENT_URL
orUPLOADS
in yourwp-config.php
, remove them. Similarly, delete any possible settings in the database by loadingwp-admin/options.php
in your browser & emptying the values forupload_path
&upload_url_path
.