WordPress.org

Ready to get started?Download WordPress

Forums

Moving site to another folder - image links (8 posts)

  1. rusty1001
    Member
    Posted 1 year ago #

    Hi
    I want to move a site to another folder,

    If I look in the html of a post <img src="http://website.com/wordpress/wp-content/themes/twentyten/images> is the link ...

    I tested out changing to /wordpress2/

    and the image link in the page in the html it was still wordpress/wp-content/themes/twentyten/images in the page

    does this change or supposed to change when you change the folder or site location, Will I have to insert all images again?

    Thanks

  2. keesiemeijer
    moderator
    Posted 1 year ago #

    Are the "WordPress address (URL)" and "Site address (URL)" correct under: wp-admin > Settings > General?

    See here how tho move wordpress:
    http://codex.wordpress.org/Moving_WordPress
    http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

  3. rusty1001
    Member
    Posted 1 year ago #

    Thanks - yes I have seen those thanks

    All I am asking if I move the site I dont have to change the content image links, they will update,

    in some cms's image link in content is <img href="/images/28229.jpg
    in Wp it seems to have the absolute link <img href="http://site/images/ etc

    Just making sure they will not have to be changed ?
    Thanks

  4. keesiemeijer
    moderator
    Posted 1 year ago #

    The images in your post content have to replaced (with an absolute url) by a search and replace script: http://interconnectit.com/124/search-and-replace-for-wordpress-databases/

    Make a backup of your database first.

  5. rusty1001
    Member
    Posted 1 year ago #

    I have not read anything about this, anywhere in the "move site" links,

    are you saying every image link in content will have to be changed,

    so there is no dynamic linking to images?

    Thanks

  6. keesiemeijer
    moderator
    Posted 1 year ago #

    I have not read anything about this, anywhere in the "move site" links

    It's right here: http://codex.wordpress.org/Moving_WordPress#When_Your_Domain_Name_or_URLs_Change

    so there is no dynamic linking to images?

    What do you mean by dynamic linking to images? The links in the post content (in the database) don't change by itself when moving a site.

  7. rusty1001
    Member
    Posted 1 year ago #

    in some cms's image link in content is <img href="/images/28229.jpg
    in Wp it seems to have the absolute link <img href="http://site/images/ etc

    Will I have to change image links in the HTML content when I move the site is what I am asking, thanks

  8. keesiemeijer
    moderator
    Posted 1 year ago #

    Use absolute links in your (theme template files ) html. In html this "/images/28229.jpg" will link to the root website address "site.com/images/28229.jpg" and not "site.com/wordpress2/images/28229.jpg".

    Use one of these functions to determine the url in your theme template files:
    http://codex.wordpress.org/Determining_Plugin_and_Content_Directories

Topic Closed

This topic has been closed to new replies.

About this Topic