Mixed Content Error: HTTP/HTTPS Mixed Content

Identify and fix HTTP resources blocking your HTTPS site.

Mixed content error occurs when an HTTPS page loads resources via insecure HTTP. This can include images, JavaScript scripts, CSS stylesheets, fonts, or AJAX requests. Modern browsers block these resources to protect users.

Mixed content compromises the security of your HTTPS site. Even if the main page is encrypted, an HTTP resource can be intercepted or modified by an attacker. That's why browsers are increasingly strict about this.

This guide helps you identify all resources causing mixed content errors and fix them. We'll also see how to prevent this problem during HTTP to HTTPS migrations.

Mixed Content Symptoms

How mixed content manifests:

Mixed Content Sources

Common causes of mixed content:

Identify Mixed Content

Use these methods to find problematic resources:

  1. Developer console: open F12 > Console. Mixed content errors are listed with exact resource URLs.
  2. Why No Padlock: the whynopadlock.com tool scans your page and lists all insecure resources.
  3. Chrome DevTools Network: in the Network tab, filter by "mixed-content" to see blocked requests.
  4. Full site scan: tools like Screaming Frog or JitBit HTTPS Checker scan your entire site.

Mixed Content Fixes

How to fix common problems:

<!-- BEFORE: Hardcoded HTTP URL -->
<img src="http://example.com/image.jpg">
<script src="http://cdn.example.com/script.js"></script>
<link href="http://fonts.googleapis.com/css?family=Open+Sans">

<!-- AFTER: Protocol-relative or HTTPS URL -->
<img src="https://example.com/image.jpg">
<script src="https://cdn.example.com/script.js"></script>
<link href="https://fonts.googleapis.com/css?family=Open+Sans">

<!-- OR: Relative URL (recommended for same domain) -->
<img src="/images/image.jpg">
<script src="/js/script.js">

<!-- In PHP: Dynamic URL -->
<img src="<?= rtrim($_ENV['APP_URL'], '/') ?>/images/image.jpg">

<!-- CSP header to block and report mixed content -->
Content-Security-Policy: upgrade-insecure-requests;
Content-Security-Policy-Report-Only: default-src https:; report-uri /csp-report

Replace HTTP URLs with HTTPS or use relative URLs. The upgrade-insecure-requests header tells the browser to automatically convert HTTP requests to HTTPS.

Best Practices

Prevent mixed content with these practices:

Mixed Content Checklist

  • Developer console checked for mixed content errors
  • Hardcoded HTTP URLs replaced in code
  • Database updated
  • External resources verified (CDN, fonts, widgets)
  • CSP header configured
  • Full site scan performed

Frequently Asked Questions

Does mixed content affect SEO?

Indirectly yes. Google prefers fully HTTPS sites. Also, blocked resources can break your site and increase bounce rate.

Can I ignore mixed content warnings?

Not recommended. Browsers block more and more mixed content. What works today may be blocked tomorrow.

How do I fix mixed content in WordPress?

Use a plugin like Better Search Replace to replace http:// with https:// in the database. Also check the theme and plugins.

What if an external resource isn't available in HTTPS?

Host the resource locally on your server, or find an HTTPS alternative.

Is passive mixed content dangerous?

Passive content (images) is less dangerous than active (scripts) but still compromises the privacy and integrity of your page.

Does MoniTao detect mixed content?

MoniTao monitors SSL certificate validity. For mixed content, use specialized tools like whynopadlock.com.

Eliminate Mixed Content

Mixed content is a common problem during HTTPS migrations, but it's entirely fixable. Take time to audit your site and fix all HTTP references.

Combine MoniTao SSL monitoring with regular mixed content audits to ensure your site remains fully secure.

Ready to Sleep Soundly?

Start free, no credit card required.