Support » Installing WordPress » Moving wordpress – absolute paths in posts

  • I have wordpress installed on my local computer, so it’s running on http://localhost/wordpress. I’ve created posts, pages and everything and now I want to move the installation to my webhosting server. The problem seems to be that the images in my posts (that were ‘uploaded’ into my wordpress installation with the standard flash uploader) refer to the absolute path, for example http://localhost/wordpress/wp-content/uploads/2009/03/image.jpg. I checked this in phpMyAdmin. So when I move the wordpress installation to my webhost’s server, the images are still linking to my local computer. I could change all the paths in phpMyAdmin, but I’m wondering what went wrong in the first place. Is this behavior intended? I couldn’t seem to find other users having the same problem so I guess not.

    So what’s the best solution for this problem, what did I do wrong, and how can I prevent this from happing next time?


Viewing 4 replies - 1 through 4 (of 4 total)
  • You would have to change the references from localhost to your ‘new domain’.

    Look at

    Thanks for your reply and thanks for the link. I take it from your answer, that there’s no way to prevent this in the future?

    I’ve seen some discussion about storing images in a relative fashion but don’t know how far that has progressed. Maybe someone else has input on that.

    all the absolute addresses in the 2 database tables, wp_postmeta and wp_posts wreck wordpress’s portability.

    On my wp site, I removed the root portion of all the absolute addresses in both tables (a global search and replace in my editor) and everything, all my images and links, now work fine (and I have hundreds).

    Yes, now the issue is how to keep them out. I now upload images with my ftp program, not wp and then spell out only the relative path to the image in the add/edit a post/page textarea.

    consider how wp_includes/images works.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Moving wordpress – absolute paths in posts’ is closed to new replies.