Skip to content

How to Fix the Mixed Content Error

Key idea:

Mixed Content happens when an HTTPS page loads HTTP resources (images, scripts, iframes). Chrome blocks active (scripts/iframes) fully, passive (images) triggers a warning. Fix: replace every http:// with https:// or // (protocol-relative), or set Content-Security-Policy: upgrade-insecure-requests.

Below: step-by-step, working examples, common pitfalls, FAQ.

Step-by-Step Setup

  1. Open DevTools → Console → find "Mixed Content: The page was loaded over HTTPS" errors
  2. Scan the site with Enterno Mixed Content Scanner for the full list
  3. Replace HTTP URLs in HTML: http://cdn.old.com → https://cdn.old.com
  4. WordPress: SQL UPDATE wp_posts SET post_content = REPLACE(post_content, "http://example.com", "https://example.com")
  5. Bitrix: admin → Settings → Sites → change server_name and run "Convert links"
  6. Add header: Content-Security-Policy: upgrade-insecure-requests; — upgrades HTTP → HTTPS automatically
  7. Re-scan — should be 0 violations

Working Examples

ScenarioConfig / Record
nginx: CSP upgrade-insecure-requestsadd_header Content-Security-Policy "upgrade-insecure-requests;" always;
Apache: .htaccessHeader set Content-Security-Policy "upgrade-insecure-requests;"
HTML meta fallback<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests;">
Protocol-relative URL<img src="//cdn.example.com/logo.png"> (works on both HTTP and HTTPS)
WordPress pluginReally Simple SSL — auto-replace + HSTS

Common Pitfalls

  • CSP upgrade-insecure-requests fails if the CDN itself does not serve HTTPS — resource 404s
  • <a href="http://..."> is not mixed content, but UX suffers — replace everything
  • JavaScript XMLHttpRequest to HTTP endpoints is blocked silently — verify manually
  • iframe with an HTTP source is active mixed content, blocked entirely by Chrome
  • WebSocket ws:// on an HTTPS page is also blocked — use wss://
HTTP on HTTPS SiteResources over insecure protocol
Active ContentJS/CSS blocked by the browser
Passive ContentImages with security warning
Page ResourcesAll external resources checked

Why teams trust us

HTTP
mixed content detection
HTTPS
security check
CSS/JS
all resource types
Free
no limits

How it works

1

Enter page URL

2

Scan all resources

3

Find HTTP resources on HTTPS

What is Mixed Content?

Mixed Content is loading HTTP resources (images, scripts, CSS) on an HTTPS page. Browsers block active mixed content (JS, CSS) and warn about passive (images).

Resource Scanning

Find all HTTP resources on the page: scripts, styles, images, frames.

Threat Classification

Divide into active (critical) and passive (non-critical) mixed content.

Problem URL List

Each HTTP resource listed with type and fix recommendation.

Fast Check

Results in seconds — we check the page without full browser rendering.

Who uses this

Security

post-HTTPS migration audit

Developers

insecure resource detection

SEO

browser warning fixes

Sysadmins

third-party resource audit

Common Mistakes

Ignoring passive mixed contentHTTP images aren't blocked, but the browser shows a warning in the address bar.
Not checking after adding JSThird-party scripts may load HTTP resources. Check after connecting them.
Using absolute HTTP URLsUse relative URLs or // scheme everywhere to adapt to protocol.
Not configuring CSPContent-Security-Policy: upgrade-insecure-requests automatically upgrades HTTP to HTTPS.

Best Practices

Use <code>upgrade-insecure-requests</code>CSP directive automatically upgrades all HTTP resources to HTTPS.
Check on deployInclude mixed content check in your CI/CD pipeline.
Use relative URLssrc="/images/logo.png" instead of src="http://example.com/images/logo.png".
Monitor third-party widgetsSocial media widgets and ad systems are a frequent source of mixed content.

Get more with a free account

Mixed content check history and HTTPS security monitoring.

Sign up free

Learn more

Frequently Asked Questions

Difference between active and passive mixed content?

Active — scripts, iframes, stylesheets, XHR — can execute code with the HTTPS page's privileges. Chrome blocks entirely. Passive — images, audio, video — only displayed. Warning but not blocked.

Can I disable the block?

Per-site in Chrome: Settings → Privacy → Site settings → Insecure content → Allowed for specific site. Dangerous in production — use only for dev.

Does upgrade-insecure-requests work everywhere?

Chrome 43+, Firefox 42+, Safari 10.1+. IE does not support it, but modern browsers cover 98% of traffic.

How do I prevent mixed content in new articles?

CMS plugin for auto-replace on save (WordPress: Really Simple SSL), Git pre-commit hook for content, CSP-report monitoring in production.