0

I will try to explain myself as best as possible:

  • I have a live WordPress website which has over 600 posts and 1000 images used in these posts.
  • I have a local copy running at http://localhost/my-wordpress-site.
  • I use WP Migrate DB to export posts from the live site.
  • When I export with WP Migrate DB, it finds and replaces the live site URL (//my-wordpress-site.com) with the local URL (//localhost/my-wordpress-site) so that links will work locally.

The problem I have is that it changes the links to all the images. My goal is to keep the image links the same (i.e. pointing to the images on the servers) so I don’t have to download thousands of images to my local machine.

How can I keep the images URLs pointing to the images on the server? Do I have to modify the DB directly?

2
  • If you're referring to any images that are placed in post/page content via the text-editor, this isn't something that you can just change a table or two in the db and it will apply everywhere. There is a wp_posts table that shows the data for all posts and a "content" column, but you'll be there literally forever trying to go that route. If you change the site url or home url, that's going to affect your local url. Try this plugin: wordpress.org/plugins/upload-url-path-enabler
    – RachieVee
    Dec 9, 2014 at 18:25
  • Also you can try this method if that plugin doesn't help, this is a code method without tinkering with the database: blog.room34.com/archives/5091
    – RachieVee
    Dec 9, 2014 at 18:29

1 Answer 1

0

Try changing "siteurl" and "home" in your wp_options table. The rest of the paths should stay the same then.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.