• I have a lot of images and now I have upgrade from http to https I notice all the images still have a http://

    Is there a method to automatically update the url’s

    Regards
    Drachsi

Viewing 8 replies - 1 through 8 (of 8 total)
  • You could do a search and replace on your database. This article has some good info:
    http://www.hongkiat.com/blog/how-to-search-and-replace-wordpress-in-blog-post/

    Is not unusual to just add a Rewrite rule to your .htaccess file also just to make sure everything is https. More info:
    https://www.captiga.com/linux/redirect-http-to-https/

    Note it’s easy to get into trouble when working on the database or .htaccess file, so if you have a test site you can try a potential solution on first that would be best. And don’t forget to backup first!

    Your web host support folks might be able to help or provide suggestions also.

    anonymized-14293447

    (@anonymized-14293447)

    I’m cueing up on this post instead of opening another one (this forum is very crowded).
    My experience is that plugins don’t always work on this matter, and most of them need to stay installed because they don’t make permanent fix but force them as they come. So I understand it’s always better to make SQL queries. They will last forever.
    But I’m no expert and I have done my research, in order to change http>https both in images and in posts (or images within posts).

    images in database: UPDATE wp_posts SET post_content=(REPLACE (post_content, '<old-url>','<new-url>'));

    images in custom_fields: UPDATE wp_postmeta SET meta_value= replace(meta_value, '<old-url>', '<new-url>');

    Can anyone confirm that the codes above are correct and not deprecated?

    Thread Starter Drachsi

    (@drachsi)

    Thanks for the feedback. A recommended Plugin did not work. I would have thought this was a common problem with a solution already?

    Drachsi

    anonymized-14293447

    (@anonymized-14293447)

    I haven’t tested those SQL queries, but I’m gonna do it soon because I just tried with another of those famous plugins, and still it didn’t do the job.

    I did a quick test and this works for me:

    UPDATE wp_posts SET post_content = REPLACE (
    post_content,
    'http',
    'https');

    Thread Starter Drachsi

    (@drachsi)

    Hi Dan,

    Sorry I’m just a normal guy and have no idea how to use your information, and I think I need just to change the url of all the images to https

    anonymized-14293447

    (@anonymized-14293447)

    @drachsi, backup your database and then try to follow these steps, you need to have access to your cPanel

    Hey Drachsi – if your host doesn’t provide a cPanel or phpMyAdmin, you might want to try using the Adminer plugin to run sql commands on the database:
    https://wordpress.org/plugins/adminer/

    After activating you would go under Tools > Adminer > Start Adminer Inside > click SQL Command in the left column then paste in the command and click Execute.

    Working on the database and learning some mysql stuff can get geeky, but it might come in handy for other needs also, such as backing up your entire database using Export.

    Just in case something goes wrong you might check if your host keeps a backup of your site too (and also check their backup actually works).

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘How can I upgrade media file url's from http to https?’ is closed to new replies.