• Resolved masok

    (@masok)


    Hi all,

    So, I have wordpress running locally (using docker), and everything is working fine.

    At some point, I made some unrelated changes in my router, and my IP changed.

    I went into WordPress settings>General, and changed the WordPress and Site URL to the new IP (previously, I had the previous IP)

    Now, everything works, but a few images.

    Went into WordPress configuration again, and then into Media, and got a message saying that the database needed to be updated, so I ran that process, and a few images came back.

    But there are a few that are still now showing

    When I right click on them and see the IP, it shows the previous IP, not the new one.

    But if I go into media (in wordpress configuration), they show with the new IP.

    Is there something else I should be updating to get the new IP reflected everywhere?

    I know this might be a stupid question but I cannot figure it out.

    Thanks in advance!

Viewing 4 replies - 1 through 4 (of 4 total)
  • When you upload any file (including images) with WordPress, WordPress stores the absolute URLs of these files in the database.

    So when you change the site address as you’ve done, you’re still stuck with all previously-uploaded files having the old site address in their URLs. Hence broken files!

    The solution to this, as documented in the official guide, is to do a FULL a search-and-replace on the database to swap out the old domain (IP in your case) with the new.

    Thread Starter masok

    (@masok)

    Thanks so much!

    Thread Starter masok

    (@masok)

    @gappiah

    Might have replied too soon

    So I ran the command mentioned on the post:

    UPDATEwp_posts SETpost_content = REPLACE(post_content,’192.168.1.1:8000′,’192.168.1.2:8000′);

    I ran this from phpmyadmin SQL section

    The change went fine, no errors

    But still, URLs have not changed

    I do see in wp_posts, that the guid field still mentions the old IP, but the document you provided said to never ever change that field

    Thread Starter masok

    (@masok)

    Well, ended up just deleting those images and re uploading them.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Some images not loading after IP change’ is closed to new replies.