WordPress.org

Ready to get started?Download WordPress

Forums

Moving wordpress - absolute paths in posts (5 posts)

  1. tomrijndorp
    Member
    Posted 5 years ago #

    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?

    Thanks.

  2. MichaelH
    Member
    Posted 5 years ago #

    You would have to change the references from localhost to your 'new domain'.

    Look at http://wordpress.org/extend/plugins/search-and-replace/

  3. tomrijndorp
    Member
    Posted 5 years ago #

    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?

  4. MichaelH
    Member
    Posted 5 years ago #

    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.

  5. ggsmith
    Member
    Posted 5 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic