Mixed Content Error

Category: Security & SSL ยท Updated 2026-11-01

A mixed content error occurs when a page loaded securely over HTTPS also tries to load some resources, such as images, scripts or stylesheets, over plain unencrypted HTTP. Browsers block the riskiest resource types outright and warn about or quietly allow the rest, which can break page functionality and trigger "Not Secure" warnings.

Why mixed content happens

It typically happens after a site moves from HTTP to HTTPS but some old links were never updated: an image tag, a script source, a stylesheet link or an iframe still points to an http:// address instead of https://. Because the main page is encrypted but a piece of it is not, the browser calls this mixed content and treats it as a security risk, since an attacker on the network could tamper with that one unencrypted resource to attack an otherwise secure page.

Passive vs. active mixed content

TypeExamplesBrowser behavior
Passive mixed contentImages, video, audioUsually loaded anyway, but the browser shows a warning or removes the padlock icon
Active mixed contentJavaScript, CSS, iframes, fonts, XHR/fetch requestsBlocked by default in modern browsers, since these can change page behavior or steal data

Active mixed content is the more serious category because scripts and stylesheets can alter what a page does, not just what it looks like, so browsers refuse to load them rather than merely warning.

How to find and fix mixed content

  1. Open your browser's developer console on the affected page; blocked or warned resources are listed there with the exact HTTP URL.
  2. Search your site's templates, theme files and database for hardcoded http://yourdomain.com references and change them to https://.
  3. For WordPress and similar CMS platforms, use a proper search-and-replace tool rather than a plain database query, since some content is stored in a serialized format that breaks with a naive text replace.
  4. Update any third-party embeds, ad scripts or widgets to their HTTPS versions; most providers support it.
  5. Re-check the page in developer tools to confirm no HTTP requests remain.

As a stop-gap while you clean up references, you can add a header that tells the browser to upgrade insecure requests automatically:

Content-Security-Policy: upgrade-insecure-requests

This header rewrites HTTP sub-resource requests to HTTPS automatically, but it works only if the resource is actually available over HTTPS somewhere; it is a mitigation, not a substitute for fixing the underlying links.

Preventing it from coming back

  • Use protocol-relative or relative URLs (//example.com/file.js or /file.js) instead of hardcoding http://.
  • Redirect all HTTP traffic to HTTPS at the server level with a 301 redirect, so old links are caught at the source.
  • Recheck mixed content after importing content, restoring backups, or migrating from another host, since these often reintroduce old HTTP references.

Frequently asked questions

What is a mixed content error?

It is a browser warning or block that happens when a page loaded over secure HTTPS also tries to load a resource, such as an image or script, over plain unencrypted HTTP.

Why does my HTTPS site still show "Not Secure"?

This usually means some resource on the page, often an image, font or script, is still being loaded over HTTP. The browser downgrades its trust indicator even though the main page itself uses HTTPS.

How do I fix mixed content in WordPress?

Use a proper search-and-replace plugin or the WP-CLI search-replace command to update hardcoded http:// links to https://, since WordPress stores some data in a serialized format that a plain find-and-replace in the database can corrupt.

What is the difference between active and passive mixed content?

Passive mixed content covers things like images or video, which browsers usually still load with a warning. Active mixed content covers scripts, stylesheets and iframes, which browsers block outright because they can change how the page behaves.

Can I force all resources to load over HTTPS with one setting?

A Content-Security-Policy header with upgrade-insecure-requests will rewrite HTTP sub-resource requests to HTTPS automatically, but only if an HTTPS version of that resource actually exists. It helps as a quick mitigation, not a full fix.

Does mixed content break the whole page?

Not usually the whole page, but blocked active content, such as a script that powers a menu or a form, can break specific features even while the rest of the page loads normally.

Related topics