TutorialsJanuary 30, 2026 8 min read

How to Fix Mixed Content Errors: Complete Guide

Learn how to identify and fix mixed content errors on HTTPS sites. Complete guide to resolving HTTP resource loading on secure pages.

WizStatus Team
Author

Mixed content errors occur when an HTTPS page loads resources via insecure HTTP, compromising the security of the entire page.

These errors are among the most common and frustrating HTTPS issues, often appearing after migrating to HTTPS or when integrating third-party content.

Modern browsers block or warn about mixed content to protect users. This can break functionality or display security warnings even on otherwise properly configured sites.

This guide covers:

  • What mixed content is
  • Why it's a problem
  • How to identify it
  • How to fix it permanently

What is Mixed Content

Mixed content occurs when a page loaded over HTTPS (secure) includes resources loaded over HTTP (insecure).

This creates a security risk because an attacker can modify the unencrypted HTTP content even though the main page is secure.

The Two Types of Mixed Content

Active mixed content (blocked by browsers):

  • JavaScript files
  • CSS stylesheets
  • Iframes
  • AJAX/Fetch requests
Active mixed content is particularly dangerous because a modified script can compromise the entire page, steal cookies, or redirect users.

Passive mixed content (with warning):

  • Images
  • Videos
  • Audio files
  • Fonts

Passive content is less critical because it cannot execute code, but it still exposes information about browsing behavior.

Why Mixed Content is a Problem

Mixed content causes several significant problems:

1. Security Compromise

The whole point of HTTPS is to protect all page content. HTTP elements create holes in that protection.

An attacker on the network can:

  • Modify HTTP content
  • Inject malicious code
  • Steal sensitive data
  • Redirect users

2. Browser Blocking

Modern browsers block active mixed content by default:

Mixed Content: The page at 'https://example.com/' was loaded over HTTPS,
but requested an insecure script 'http://cdn.example.com/script.js'.
This request has been blocked; the content must be served over HTTPS.

3. SEO Impact

Google considers HTTPS security in its rankings. Mixed content compromises this signal and can affect your positioning.

4. Loss of Trust

Security-aware users will recognize the warnings (missing green padlock) and lose trust in your site.

How to Identify Mixed Content

Via Browser Console

Open developer tools (F12) and check the console:

// Example console warning
Mixed Content: The page at 'https://yoursite.com/' was loaded over HTTPS,
but requested an insecure image 'http://cdn.external.com/image.jpg'.

Via Network Tab

  1. Open DevTools (F12)
  2. Go to the Network tab
  3. Filter by scheme:http to see insecure requests

Online Tools

Several tools can scan your site:

For Large Sites

Use crawling tools like Screaming Frog to identify issues across many pages.

Configure Content Security Policy (CSP) reports to be automatically alerted when mixed content is detected on your site.

Best Practices for Fixing

1. Update Your Own Resources

For content you control, update the references:

<!-- ❌ Before -->
<script src="http://yoursite.com/script.js"></script>
<img src="http://yoursite.com/image.png">

<!-- ✅ After - Relative URLs -->
<script src="/script.js"></script>
<img src="/images/image.png">

<!-- ✅ After - Protocol-relative URLs -->
<script src="//yoursite.com/script.js"></script>

2. Update Third-Party Content

Check if your third-party providers support HTTPS:

<!-- ❌ Before -->
<script src="http://cdn.external.com/library.js"></script>

<!-- ✅ After -->
<script src="https://cdn.external.com/library.js"></script>
If a third-party provider doesn't support HTTPS, consider hosting the resource locally or finding an alternative.

3. Implement Content-Security-Policy

Add this directive to automatically upgrade HTTP requests:

# In your server configuration
Content-Security-Policy: upgrade-insecure-requests;

Or in HTML:

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

4. Proxy for User Content

For user-submitted images (forums, comments), implement a proxy:

// Conceptual example of an image proxy
const secureImageUrl = `https://yoursite.com/proxy?url=${encodeURIComponent(userImageUrl)}`

Correction Checklist

  • Audit all pages with DevTools
  • Update internal URLs to HTTPS or relative
  • Check third-party integrations (analytics, widgets, CDN)
  • Add the upgrade-insecure-requests header
  • Test after each change
  • Configure CSP alerts for the future

Conclusion

Mixed content errors compromise HTTPS security and create a poor user experience.

By understanding the types of mixed content and systematically identifying sources, you can resolve these errors and deliver a fully secure experience.

Key steps:

  1. Use HTTPS for all resources
  2. Update third-party references
  3. Implement Content Security Policy
  4. Regularly monitor for new errors
WizStatus includes SSL monitoring that checks for proper HTTPS configuration, helping you maintain a clean security posture and detect certificate issues before they affect your users.

Related Articles

Certificate Transparency Logs: Detect Unauthorized Certificates
Security

Certificate Transparency Logs: Detect Unauthorized Certificates

Learn how Certificate Transparency logs help detect unauthorized SSL certificates. Understand CT monitoring and protect your domains from certificate fraud.
8 min read
How to Get SSL Certificate Expiry Email Reminders
Security

How to Get SSL Certificate Expiry Email Reminders

Never let an SSL certificate expire unexpectedly. Set up automatic email reminders for SSL expiration to prevent website security warnings and downtime.
7 min read
HSTS Implementation Guide: Force HTTPS the Right Way
Tutorials

HSTS Implementation Guide: Force HTTPS the Right Way

Learn to implement HTTP Strict Transport Security (HSTS) correctly. Complete guide to HSTS configuration, preloading, and avoiding common mistakes.
10 min read

Start monitoring your infrastructure today

Put these insights into practice with WizStatus monitoring.

Try WizStatus Free