Monitory
← All guides

Guides

How to find and fix mixed content on your website

Why browsers block or flag HTTP resources on an HTTPS page, where they come from and how to fix them for good.

What mixed content is

Mixed content is a page served over HTTPS that loads some of its resources over plain HTTP: images, scripts, stylesheets, iframes, video or audio. The page is only as safe as its weakest resource, so browsers react.

What browsers do

  • Scripts, styles and frames loaded over HTTP are blocked, which breaks the page.
  • Images over HTTP are loaded, but the browser shows a warning instead of the padlock.

Visitors see a broken layout or a site that looks unsafe, and neither makes them trust you.

Where it comes from

  • Hard-coded http:// URLs in templates or in content written years ago.
  • Images inserted in a CMS before the site moved to HTTPS.
  • Third-party widgets, fonts or scripts loaded over HTTP.

Find it

Browsers only report mixed content on the page you are looking at. A crawler reads every page. The mixed content check crawls your site once a day and lists every insecure resource together with the page it was found on, so you fix the source instead of hunting for it.

Fix it

  1. Hard-coded URLs: change http:// to https://, or to relative URLs. In a CMS, search the database for http://yourdomain and replace it.
  2. Third-party resources: load them over HTTPS. If a provider does not support HTTPS, replace it.
  3. A safety net: send the header Content-Security-Policy: upgrade-insecure-requests, which asks browsers to load every resource over HTTPS. Treat it as a net, not as a fix for the source.
  4. Pages you cannot change: use the ignore setting of the check to skip URL patterns such as /blog/archive/*.

Keep it fixed

Mixed content comes back whenever someone pastes an old link into a page. Because the check runs every day, you hear about it soon after the page changes.

Keep reading