1

I just noticed that all my images in "Media" have the "http://...." URL under "File URL:".

I certainly have SSL installed and under Settings > General the domain is correctly set with https. Is this set somehwere else or is there something else I could configure this?

Thank you :)

2 Answers 2

-2

That's because the image (media) URL is stored as part of the record in the posts table. (Images/media are another type of post.)

You have several choices:

  1. Manually change each media URL to https. This might take a while if you have lots of pictures. Not really recommended.

  2. Use phpMyAdmin to change the value. There are several googles/bings/ducks on how to do this. But also not recommended - playing with the database can be dangerous.

  3. Use a plugin to fix things. One such is "Better Search and Replace". It will do it all for you. Instructions are clear, and it is an established and well-supported plugin. It also has a 'test' mode that doesn't do anything, but shows you what would have been done. I have used this many times.

Also, make sure that you have changed your htaccess file to force requests to use HTTPS. Your hosting place will usually have instructions on how to do this.

2
  • The question seems to be referring the reported URL in the Media library. That URL is not stored in the database. Only the path is stored. Commented Jan 4, 2023 at 2:30
  • Thank you both. Indeed, using "Better Search and Replace" fixed the issue. For any future readers. The wp_posts and wp_postmeta are the two databases that deal with media links. :)
    – Boxhamster
    Commented Jan 4, 2023 at 15:17
2

Sometimes it happens because on your 1 - Settings > General > WordPress Address(URL) AND 2 - Settings > General > Site Address (URL)

the url has http://www.yourwebsite.com instead of https://www.yourwebsite.com

Once you have changed it, from a post remove and add the same image again, it should be work if that is the case

2
  • Nailed it, that was the exact problem
    – brasofilo
    Commented Apr 30 at 14:28
  • First confirm in your WP "Settings/General" that your Address URLs are HTTP. If so, change them to HTTPS. After this change confirm that the "file URL" of images in "Media" should show HTTPS too. At this point the images on your Website will likely still be HTTP, but "relinking" them should fix that.
    – drake7
    Commented Jun 15 at 15:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.