WebTrickz
TRENDING
  • How to Turn Off and Restart iPhone 15
No Result
View All Result
  • Reviews
  • Editorials
  • Social Media
    • Facebook
    • Twitter
    • YouTube
    • Messenger
    • Instagram
    • Snapchat
    • WhatsApp
    • TikTok
  • Apps
  • How To’s
  • Apple
  • iPhone
  • Google
  • Android
  • Mac
  • Security
  • About Us
    • About Us
    • Contact Us
    • Privacy Policy
  • Reviews
  • Editorials
  • Social Media
    • Facebook
    • Twitter
    • YouTube
    • Messenger
    • Instagram
    • Snapchat
    • WhatsApp
    • TikTok
  • Apps
  • How To’s
  • Apple
  • iPhone
  • Google
  • Android
  • Mac
  • Security
  • About Us
    • About Us
    • Contact Us
    • Privacy Policy
No Result
View All Result
WebTrickz
No Result
View All Result
Home Blogging

How to Change Image URLs from HTTP to HTTPS in WordPress

An easy way to fix mixed content warning in WordPress due to HTTP images.

Mayur Agarwal by Mayur Agarwal
February 22, 2024
in Blogging, How To's

Recently, I moved this website to HTTPS / SSL which is hosted on WordPress CMS. The migration from HTTP to HTTPS went smoothly and the permanent redirection to HTTPS was successful too. Soon after propagation, the HTTP pages were redirecting to their HTTPS equivalents and were showing a green padlock sign. The only issue was that most of the HTTPS pages were showing mixed content warnings.

webtrickz https enabled site
WordPress site with HTTPS enabled

Due to such warnings, the pages don’t show a Secure tag aka padlock, and instead say “Your connection to this site is not fully secure” or “This connection is not Private”.

Your connection to this site is not fully secure
An example of mixed content warning in WordPress

This problem arises when the page resources link to HTTP URLs instead of HTTPS, thus labeling them as an insecure element. The mixed content warning is usually caused by images added on pages that are still loading with the HTTP URL. This issue doesn’t stem from the SSL setup itself and needs to be fixed as a part of the migration process to HTTPS.

I intensely searched through a lot of sources to find a precise way to update image links from HTTP to HTTPS after SSL migration in WordPress. However, I couldn’t find a single guide that could help a first-timer to accomplish this technical task with ease. After much brainstorming and going through a lot of articles, I finally figured out a simple solution to fix not secure error on HTTPS pages.

Guide to Update Images to HTTPS in WordPress

I’ll keep this guide simple and straight to the point so that newbies don’t get confused like me.

We will be using the “Better Search Replace” plugin for WordPress that packs the best features found in similar plugins. You can perform this entire task without logging into phpMyAdmin to run any SQL queries which could mess up your site in case anything goes wrong.

Before proceeding, note that this tutorial is applicable for WordPress users who have set a 301 redirection and are using only the HTTPS protocol on their website or blog. Although this would work in most scenarios, one needs to consider other factors too if the problem persists.

1. Change WordPress Home and Site URL to HTTPS

Go to your WordPress dashboard > Settings > General. Now change the WordPress Address and Site Address URL to HTTPS instead of HTTP. (Refer image)

Wordpress general settings
HTTP to HTTPS redirect in WordPress

This makes WordPress itself handle the redirect. Additionally, all internal links within the WordPress app and website will be set to their HTTPS equivalents. This would state that every bit of the website is, and leads to, encrypted content. Just to be sure, you can add the below rule to your .htaccess file.

RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-SSL} !on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

This 301 redirect will make sure to redirect any HTTP request to HTTPS.

2. Change Media Assets (Images, Internal links) from HTTP to HTTPS

Coming to the main step. You now need to replace all the old HTTP URLs in the WordPress database with HTTPS. This means updating all the image file links and internal links added manually (in posts or pages) to HTTPS to prevent any insecure image warning and fix the mixed content error. However, there is no need to update external links pointing to other websites to HTTPS.

WARNING: Make sure to backup your database first.

Replace HTTP to HTTPS with Beter Search Replace Plugin

To proceed, install the “Better Search Replace” WordPress plugin and activate it.

Now head over to the plugin page located under the Tools section. In the “Search for” field enter the HTTP version of your website URL and the HTTPS version in the “Replace with” field. Under select tables, scroll down and select the “wp_posts” table which contains image URLs, and URLs embedded inside posts and pages. Then uncheck the “Run as dry run?” option and hit the Run Search/Replace button.

How to Change Image URL from HTTP to HTTPS in WordPress
Change image URL from HTTP to HTTPS in WordPress with Better Search Replace

Wait for the processing to take place. You can later view details such as the number of changes found and rows updated for the particular table.

better search replace plugin

NOTE: If you get an error during processing, go to the Settings tab and try decreasing the “Max Page Size” value to anywhere around 8000 to 10000.

That’s it! The HTTP version of your website’s embedded links and image URLs should now be updated with the HTTPS version.

To confirm, simply open a blog post and copy the image address within a post or view the page source. The image URLs should now show the HTTPS version and you should now see a Secure padlock next to the address bar.

Images with HTTP link
Before (Image URL)
Images with HTTPS link
After (Image URL)
Internal links with HTTP
Before (Internal Link URL)
Internal Link URL with HTTPS
After (Internal Link URL)

Bonus Tip: After replacing HTTP with HTTPS successfully, you can remove the plugin.

Find why HTTPS site is not showing a green padlock

Do note that some pages with broken or unavailable links such as expired CDN might still result in mixed content. You can identify the insecure elements on such pages by using the Inspect Element feature in Chrome or just use whynopadlock.com to easily find insecure items on your SSL-enabled pages.

Reference: Check this detailed article by Michael Bely

Tags: BloggingTutorialsWordPress
ShareTweetSend
Previous Post

How to Check Airtel Broadband Unused Carry Over Data

Next Post

Facebook friend requests will now expire after 14 days

Mayur Agarwal

Mayur Agarwal

Mayur Agarwal, the founder and editor of WebTrickz, is a tech enthusiast with a Bachelor's degree in Computer Applications and over a decade of writing experience. His passion for technology and gadgets inspires him to create insightful How To's and troubleshooting guides.

Next Post
Facebook app on iPhone

Facebook friend requests will now expire after 14 days

Comments 15

  1. Prashanth says:
    7 years ago

    Thanks for this simple but most useful tips 🙂

    I also made the switch to https yesterday! The installation of SSL was done smoothly by the hosting provider as I bought SSL from them. But I also faced the same issue with Padlock. I requested the hosting provider to look in to this. In the mean time I found your article and tried the plugin my self.

    The plugin was really amazing. It solved my issue with deep linking and images. I only required to manually change one header logo.

    For your Info, I used a different code for 301 redirect.

    Reply
    • Mayur says:
      7 years ago

      Glad to hear that this post helped you. I wrote it for the sole purpose to help everyone who is stuck with this problem and can’t figure out an easy fix to it.

      Reply
  2. Jacqueline Smith says:
    7 years ago

    Thanks very much for this article. I just migrated my https site to a new host and had to purchase a new certificate. Had errors concerning my site. I searched the web and as you mentioned there was nothing that was easy for newbies.
    Carried out the instructions laid out here and my site is up and running.
    Looking at the previous comment, I too had one image that didn\’t get updated. It was the header logo, which I easily fixed by removing it then adding it gain.
    Thank you so much!!

    Reply
    • Mayur says:
      7 years ago

      Glad you found this guide useful. Happy to help 🙂

      Reply
  3. Ross says:
    6 years ago

    Great instruction Mayur. Migrating from HTTP to HTTPS is really pain in the a*s.

    Reply
  4. Andy says:
    4 years ago

    Thank you very much. This article saved me some time! 🙂

    Reply
  5. Janus says:
    3 years ago

    Thank you for this simple and great help.

    Reply
  6. Hobie van Huson says:
    3 years ago

    Brother, you just helped a fellow newbie with his image files. And all it took was step #1 and no further. Thank you.

    Reply
  7. simon says:
    3 years ago

    wow thanks for this news very helpful

    Reply
  8. Myrthe says:
    3 years ago

    Thank you so much for this simple solution!!!! Yoohoo!

    Reply
  9. James Curran says:
    3 years ago

    This was super helpful – thank you!

    Reply
  10. Katrina Singh says:
    3 years ago

    This Article Very Helpful Because I dont know how to replace http images to https then i found you article its save my life .. Thank You

    Reply
  11. Harvansh Chaudhary says:
    1 year ago

    Thanks Big Brother, you saved a lot of time of mine. all my old images URL was starting with http. i was quite worried of this http thing for past few days. you made me resolve it in one go. Thanks Again.

    Reply
  12. Billy Howie says:
    1 year ago

    You are AWESOME for posting this! Thank you!
    It has solved some problems, plus, now I know such a tool exists!

    The WordPress community is really amazing!…

    Reply
  13. SS Hindi Tech says:
    1 year ago

    Your blog always delivers quality content. Much appreciated!

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Latest Stories

ios 18

iOS 18: How to Add Screen Record to Control Center on iPhone

March 30, 2025
ios photos logo

iOS 18: How to Clear Recently Viewed Photos on iPhone

December 27, 2024
ios photos logo

How to Find Your Favorite Photos in iOS 18 on iPhone

December 30, 2024
ios 18

How to Reset Control Center to Default in iOS 18.1 on iPhone

April 2, 2025
iphone 16 pro max always-on display

How to Turn Off Always-On Display on iPhone 16 Pro & 16 Pro Max

November 11, 2024
ios 18

How to Find Recently Deleted Photos in iOS 18 on iPhone

December 30, 2024
apple iphone 16 pro

How to Close Apps on iPhone 16, 16 Pro, and 16 Pro Max

October 22, 2024

Trending Stories

  • Apple iphone 16

    How to Turn Off and Restart iPhone 16, 16 Pro, and 16 Pro Max

  • How to Put Your iPhone 16 on Vibrate or Silent Mode

  • How to Turn Off & Restart iPhone 15, 15 Pro, and 15 Pro Max

  • How to Turn Off Most Relevant Comments on Facebook

  • 4 Ways to Remove the Floating Home Button on iPhone

  • About Us
  • Contact Us
  • Privacy Policy
  • Advertise

© 2025 WebTrickz. All Rights Reserved.

No Result
View All Result
  • Reviews
  • Apps
  • How To’s
  • Android
  • Google
  • iPhone
  • Mac
  • About Us
  • Contact Us
  • Privacy Policy

© 2025 WebTrickz. All Rights Reserved.