Learn/Website

Mixed content: insecure resources on HTTPS pages

An HTTPS page should load every script, stylesheet, image, and video over HTTPS too; browsers block or upgrade anything else.

Want this checked on your own domain?

Join the waitlist

Updated

Message for whoever manages your website

Hi, our HTTPS homepage still loads some files from http:// addresses, so browsers block or upgrade them. Could you change those addresses to https:// (or to relative paths for files on our own site), and check the browser console on our main pages for any other mixed-content warnings? Thank you.

Want this checked on your own domain? Join the waitlist.

Check yours

The full domain report (join the waitlist for access) counts the http:// script, stylesheet, frame, image, audio, and video addresses in your HTTPS homepage. To see which they are, on the homepage or any other page, open the page in a browser, open the developer console, and reload: browsers log a warning for each mixed request they upgrade or block.

Fix it

  1. List the addresses. Open your homepage and other main pages with the browser console open, as in Check yours, and note each address it warns about.
  2. Change each address.
    • Files on your own site: change http:// to https://, or use a relative path such as /images/logo.png.
    • Files on other sites: open the address with https:// in your browser. If it works, switch to it. If it doesn’t, host your own copy (if the file’s license allows) or replace that service.
  3. Find where each address lives. It may be in the theme or template, in a page’s content, in a plugin or widget setting, or in a snippet of code pasted from another service. In WordPress, set both “WordPress Address (URL)” and “Site Address (URL)” under Settings → General to https://. From WordPress 5.7, switching both to https:// on a site with existing content also makes WordPress rewrite old http:// links to your own site in posts and other content as pages are served. Links to other sites still need editing.
  4. Know what doesn’t fix it. Redirecting http:// to https:// on the server doesn’t help, because browsers check the address before making the request (Cloudflare documents this for Always Use HTTPS). The Content-Security-Policy: upgrade-insecure-requests header tells browsers to request every http:// resource on the page over https:// instead. It is a useful backstop, but there is no fallback: a resource that isn’t available over HTTPS fails to load. It doesn’t change your HTML; the report notes that the addresses are upgraded. Cloudflare’s Automatic HTTPS Rewrites changes some http:// links in pages it serves.

Confirm. Reload each page with the console open and check that no mixed-content warnings remain, then run the report again.

Parts of the page are blocked as insecure

What it means. Your HTTPS homepage loads at least one script, stylesheet, frame (<iframe>), embedded object (<embed>, <object>), or responsive image (srcset) from an http:// address. The report says how many.

Why it matters. Browsers block these requests, so the page can lose its styling or features such as menus, forms, chat, video, or payment widgets. They are blocked because an attacker who alters an insecurely loaded script can read or change data on the visitor’s behalf (W3C Mixed Content §1). Google may also prefer the http:// version of a page that has insecure dependencies other than images when choosing which address to show in search.

Fix. Change each of these addresses to https:// or a relative path, as in step 2 above.

Confirm. The page looks and works the same as before, the console shows no blocked requests, and the report no longer raises this.

Some images or media use insecure addresses

What it means. Your HTTPS homepage refers to at least one image, audio file, or video by an http:// address.

Why it matters. Current browsers request these files over https:// instead: Chrome since version 80 for audio and video and version 86 for images, Firefox since 127, and Safari since 18.0. If the file isn’t available over HTTPS, it doesn’t load. Some never get that chance and are blocked outright: images whose address is an IP address (like http://192.0.2.10/logo.png) and images requested with the crossorigin attribute. Images in srcset or <picture> are blocked outright too; the report counts srcset addresses under blocked parts of the page.

Fix. Change each of these addresses to https:// or a relative path. Check each file opens at its https:// address.

Confirm. The images, audio, and video appear, the console shows no upgrade or block warnings for them, and the report no longer raises this.

Technical reference

What browsers do (W3C Mixed Content)

A request is mixed content when a page loaded over HTTPS, or any frame inside such a page, requests a URL that isn’t potentially trustworthy, such as an http:// URL (§2, §4.3). Browsers sort it into two groups (§3):

GroupIncludesWhat happens
UpgradeableImages (<img src>, CSS images such as background-image), audio, and video, including through <source>The browser rewrites http: to https: before sending (§4.1). If that request fails, the file doesn’t load.
BlockableEverything else: scripts, stylesheets, frames, fonts, fetch() and XMLHttpRequest, <object>, <embed>, and images from srcset or <picture>The request is blocked (§4.4).

Upgradeable requests aren’t upgraded, and so are blocked, when the host is an IP address or the request uses CORS, as <img crossorigin> does (§3.1, §4.1). Links that open a new page aren’t mixed content (§4.4); browsers may warn about forms that submit to http:// (§7.1). The older block-all-mixed-content directive is obsolete; upgrade-insecure-requests isn’t (§6.1).

BrowserBlocks scripts, stylesheets, framesUpgrades images, audio, video
Chrome and EdgeYesAudio and video since Chrome 80, images since Chrome 86
FirefoxYesSince Firefox 127
SafariYesSince Safari 18.0

upgrade-insecure-requests

With Content-Security-Policy: upgrade-insecure-requests, the browser rewrites every http:// subresource URL on the page to https:// before requesting it, blockable ones included, because the rewrite happens before mixed-content checks (W3C Upgrade Insecure Requests §3.1.1). Links to the same host and form submissions are upgraded too; links to other sites aren’t (§4.1). There is no fallback when the https:// request fails (§1.2.3). The directive has no effect in a Content-Security-Policy-Report-Only header (§3.1). For other Content Security Policy uses, see the security headers guide.

What the report checks

  • It reads the homepage visitors end up on, and only when that page is served over https:// with status 200 as HTML, isn’t a bot-protection page, and isn’t on another domain.
  • It parses the HTML as delivered, without running scripts, and resolves each address against the page URL and any <base href>.
  • <script src>, <link rel="stylesheet" href>, <iframe src>, <embed src>, <object data>, and srcset addresses that start with http:// give “Parts of the page are blocked as insecure”.
  • <img src>, <audio src>, <video src>, <source src>, and <video poster> addresses that start with http:// give “Some images or media use insecure addresses”. This includes images on IP-address hosts or with crossorigin, which browsers block outright.
  • When the page sends Content-Security-Policy: upgrade-insecure-requests, browsers request all of these over https:// instead, so the report says so, with their number, instead of raising either issue.
  • Not checked: CSS (url(), @import, fonts), inline styles, resources added by scripts, form actions, and pages other than the homepage.

Sources

Want this checked on your own domain?

Join the waitlist
Domain Readiness

Free checks for email, website, DNS, and registration, with plain-English fixes.

Domain Readiness™ (domainreadiness.com) is a service of Riviera Learning, LLC.