WordPress.org

Ready to get started?Download WordPress

Forums

Images not showing (6 posts)

  1. montaya
    Member
    Posted 2 years ago #

    I moved a large wp website (100+ pages) from the backend of an old html site to the root directory. After considerable problems I got most of the site working, but have this problem:
    The image galleries are working but the single images are not showing. Initially there is an empty box, where the image should be, but after s while the box disappears leaving just an empty borderless space.
    I have tried turning off and on plugins in case there was a conflict there. I have checked images in admin dashboard and the single images are there.
    Can anyone help ??????

  2. zimmi88
    Member
    Posted 2 years ago #

    Moving the site usually won't update the image references embedded in posts, I'm afraid. So, the image references embedded in your posts are pointing to where the images used to be, rather than where they are now.

    I'm imagining there's a number of solutions to this issue you could try...

    • Go through each and every post and manually update the image URLs to reflect the new site structure (blech!)
    • Add an .htaccess rule that points references for the old URL to the new URL, assuming they're on the same server.
    • Use a plugin or write a script that can go through your database records and find-replace old URL references with the new ones. You'll want to test this in a sandbox first before using this on your production server. (Related forum post: http://wordpress.org/support/topic/how-do-i-change-image-urls-after-site-migration?replies=5)

    That said, I can't say I have much experience with the latter two. The one time I've run into this issue, the number of images were relatively low, so manually going through posts was trivial.

    I hope this helps!

  3. montaya
    Member
    Posted 2 years ago #

    The path seems to be OK and is directing to the new and not the old.

    Below is an example.
    Current path:
    http://moretonbay.biz/wp-content/uploads/2011/12/Catching-bats.jpg

    Old Path would have been: (with an extra wp because it was on the backend of old html site).
    http://moretonbay.biz/wp/wp-content/uploads/2011/12/Catching-bats.jpg

    The image does not show blank area does. :)

    I am still perplexed.

    montaya

  4. montaya
    Member
    Posted 2 years ago #

    Actually as well as the box around the image showing, also the caption/title below the image is showing, it is on the image itself that is missing!!!!!!
    montaya

  5. zimmi88
    Member
    Posted 2 years ago #

    It's not the current path that's the issue... it's the fact that none of the URLs for any images you added to your posts would have been updated during the migration from directory to directory.

    When you add an image to a page or post, the image is included as a sort of reference: a source (SRC) URL is given that points to the image's location. When WordPress is moved from directory to directory, the image files move, but these pointers don't change. Hence, files not found.

    Put another way, it's as if someone at the local library moved the photo books over to another wing but didn't change around all the directional signs. Everyone would go looking in the old location for the books, but wouldn't find what they were looking for.

    An example from the HTML for http://moretonbay.biz/bay-islands-history (shortened)
    <div id="attachment_1662" {...}><img {...} src="http://www.moretonbay.biz/wp/wp-content/uploads/2012/01/Coochie-on-the-beach-with-Victoria-point-in-the-background.jpg" {...}></a><p class="wp-caption-text">Coochie on the beach with Victoria point in the background. Courtesy State Library QLD.</p></div>

    Note in the above example the SRC attribute, which is pointing to the old directory. These are the URLs you're going to want to change by removing the "/wp" portion from the file path. Because most of your images are going to be following the same pattern, you can probably use the aforementioned plugin to do a find-replace on the post/page content of every post/page (I'd try searching for src="http://www.moretonbay.biz/wp/", replacing with "http://www.moretonbay.biz/").

    I hope this helps!

  6. montaya
    Member
    Posted 2 years ago #

    It hadn't occurred to me to check the html coding on the pages involved. When I checked that I did see that the images had wp twice. Now they are working fine. Thanks you very much for putting in the time to help :)
    montaya

Topic Closed

This topic has been closed to new replies.

About this Topic