I am getting very confused. I used to take my website on my dev. server, and copy the files over to my live server, export the database in phpMyAdmin, import it via phpMyAdmin into the new database server, change the site_url and home url and voila, the site migrated fine.

All the image URLs worked fine, it seems they just used the SITE_URL for the domain part.

Then I migrated my website with WP Migrate. Suddenly, exporting via phpMyAdmin leaves all the image URLs wrong. I have to do a find and replace with WP Migrate to change them all. I don't understand, how come they are suddenly hard coded?

In short, are image URLs hardcoded or do they take the domain part from the SITE URL?

  • 2
    Images in content areas, like when you make a post are hardcoded, if you are moving a site and not changing the domain name, use your Host file, so you don't have to do anything.
    – Wyck
    Nov 10, 2013 at 21:23
  • @Wyck Thanks, I just tested it out with an image that I inserted into the featured image and an upload image feature custom field and those seem to be softcoded. Is this true? What then is the rule
    – Lucky Luke
    Nov 10, 2013 at 22:10
  • It's safe to assume that most URLS will be hardcoded, this is a design decision made by WordPress.
    – Wyck
    Nov 10, 2013 at 23:39


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.