How to Fix Mixed Content Warnings
Your site loads over HTTPS, but the padlock is missing or the console is full of warnings. The usual cause is mixed content: a secure page pulling in some resources over insecure http://. Here’s why it breaks the padlock and how to fix it for good.
The short version
Mixed content is when an HTTPS page loads images, scripts, styles or fonts over plain HTTP. Browsers block or downgrade these, which strips the padlock. Fix it by updating every resource URL to https:// (or protocol-relative), then add the CSP directive upgrade-insecure-requests as a safety net. Find offenders fast with our free scan or the browser console.
Why one HTTP resource breaks the padlock
The padlock is a promise: everything on this page arrived securely. The moment a single resource loads over HTTP, that promise is broken — an attacker on the network could tamper with that one file. Rather than show a padlock that isn’t fully true, the browser downgrades the indicator or blocks the resource outright. So even a correct SSL/TLS certificate won’t give you a clean padlock if the page itself references insecure content.
Active vs passive mixed content
Browsers treat two categories differently based on how dangerous each is.
Passive (or “display”) mixed content
Images, audio and video loaded over HTTP. These can’t execute code, so the risk is lower — an attacker could swap an image but not hijack the page. Browsers often still load these but remove the padlock and log a warning. Increasingly they auto-upgrade them to HTTPS where possible.
Active mixed content
Scripts, stylesheets, iframes, fonts and XHR/fetch requests over HTTP. These can alter the whole page, so they’re dangerous. Modern browsers block them entirely. That’s why an insecure <script> can make part of your site simply stop working — a broken menu, a missing widget, a dead form.
| Type | Examples | Browser behaviour |
|---|---|---|
| Passive | img, audio, video | Padlock removed; often auto-upgraded |
| Active | script, css, iframe, font, fetch | Blocked outright |
Step by step: finding and fixing it
- Find the offenders. Open the page, launch your browser’s developer console, and look for “Mixed Content” messages — each names the exact HTTP URL. A site scan surfaces them too.
- Fix hardcoded links. Update
http://tohttps://in your templates, theme files and content. On a CMS, this often lives in the database as well as the theme. - Handle third-party resources. If an external asset has no HTTPS version, host it yourself or replace it. Never leave an insecure third-party script.
- Update the database (CMS sites). On platforms like WordPress, run a search-and-replace across post content and settings to swap old
http://URLs forhttps://. - Re-scan. Confirm the console is clean and the padlock is back.
The CSP safety net
Once the obvious offenders are gone, add a Content Security Policy directive that tells the browser to automatically upgrade any remaining HTTP references to HTTPS before requesting them:
Content-Security-Policy: upgrade-insecure-requests
This catches stray URLs you missed — an old image link in a forgotten post, for instance — and rewrites them on the fly. It’s a backstop, not a substitute for fixing the source, but it’s a valuable one. Learn more in our CSP guide and the wider security headers checklist.
upgrade-insecure-requests only upgrades URLs that have a working HTTPS version. If a resource genuinely isn’t available over HTTPS, it will still fail — so clean up your templates and database before leaning on the header.Prevent it coming back
After you’re clean, make sure you redirect HTTP to HTTPS site-wide and use protocol-relative or absolute https:// links in new content. Adding HSTS further ensures browsers never even attempt an insecure request to your domain. Verify the whole picture with a free scan.
Frequently asked questions
Why does my site show “Not fully secure” even with a valid certificate?
Because the page loads at least one resource over HTTP. The certificate is fine; the mixed content is the problem. Find the offending URL in the browser console and switch it to HTTPS.
Why did part of my page stop working after moving to HTTPS?
An active resource — usually a script or stylesheet — is still loading over HTTP and the browser is blocking it. Update that resource to HTTPS and the feature will return.
Does upgrade-insecure-requests fix everything automatically?
It upgrades HTTP references that have a valid HTTPS equivalent, but it can’t create one that doesn’t exist. Fix your templates and database first, then use it as a safety net.
Related guides
What Is SSL/TLS? A Plain-English Guide
How SSL/TLS encryption actually works, why every website needs HTTPS, and what the padlock in the browser really proves.
Read →SSL / TLS & EncryptionTLS 1.3 Explained: What Changed and Why It Matters
A clear breakdown of TLS 1.3 — faster handshakes, forward secrecy, and how to check whether your site supports it.
Read →SSL / TLS & EncryptionSSL Certificate Types: DV, OV and EV Compared
Domain, Organization and Extended Validation certificates compared — which one your site actually needs.
Read →Check your site against this guide
Run a free ScanOpsPro scan and see how your site handles the fundamentals.
Run a free scan