Security & SSL

HTTPS Mixed Content Errors: What They Are and How to Fix Them

Mixed content errors occur when an HTTPS page loads resources over insecure HTTP, breaking your padlock and exposing visitors to security risks.

Close-up of a rusty padlock on a weathered wall, showcasing vintage charm.

Mixed content errors happen when an HTTPS page loads one or more resources — images, scripts, or stylesheets — over unencrypted HTTP. The result: browsers display a warning, the padlock disappears, and visitors question your site's security.

This guide explains the two types of mixed content, how to locate the offending resources, and how to fix them whether you run WordPress, another CMS, or plain HTML.

What Is Mixed Content and Why Does It Matter?

When you enable HTTPS on your domain, browsers expect every resource on that page to be served over HTTPS too. If even one arrives over HTTP, you have a mixed content conflict.

There are two severity levels:

  • Passive mixed content: images, audio, or video loaded over HTTP. Browsers may still display them but remove the padlock. Medium risk — an attacker could swap the image.
  • Active mixed content: scripts (<script src="http://…">), stylesheets, iframes, or XHR/fetch requests over HTTP. Browsers block these outright because they can execute code and compromise the whole page.

Since 2020, Chrome and Firefox automatically upgrade passive audio and video resources to HTTPS. Everything else still requires a manual fix.

How to Detect HTTP Resources on Your Page

Before you can fix mixed content, you need to know what is causing it.

1. Browser DevTools Console

Press F12, open the Console tab, and look for Mixed Content messages. Each entry shows the exact URL of the problematic resource.

3. Network Tab

In the Network tab, type http:// in the filter bar. Every resource requested over HTTP will appear.

3. Online Scanners

Tools like whynopadlock.com crawl your URL and list every mixed-content resource. Great for a quick audit without server access.

How to Fix Mixed Content Errors

Option 1: Update URLs from HTTP to HTTPS Directly

The cleanest fix. Search your codebase and database for every http:// reference and change it to https://. If an external resource does not support HTTPS, consider self-hosting it.

Option 2: Use Protocol-Relative URLs

Instead of http://cdn.example.com/style.css, write //cdn.example.com/style.css. The browser inherits the protocol of the current page. Caveat: this only works if the resource server already supports HTTPS.

Option 3: Content-Security-Policy upgrade-insecure-requests

Add this directive in your server configuration or as a <meta> tag inside <head>:

Content-Security-Policy: upgrade-insecure-requests

It tells the browser to attempt loading all HTTP resources as HTTPS automatically. Useful as a quick patch, but it does not replace fixing the URLs in your source code.

Option 4: WordPress — Better Search Replace or Really Simple SSL

If your WordPress site migrated from HTTP to HTTPS, the database likely still contains thousands of old HTTP URLs. Use the Better Search Replace plugin to swap http://yourdomain.com for https://yourdomain.com across all tables. The Really Simple SSL plugin also detects and fixes mixed resources automatically on activation.

If you manage hosting through a control panel, elenlace.com offers hosting plans that include free SSL and technical support for exactly these kinds of migrations.

Verify the Fix

After applying your corrections:

  1. Hard-reload the page with Ctrl+Shift+R to bypass the cache and check the address bar — it should show a clean padlock.
  2. Re-check the DevTools console; there should be no Mixed Content messages.
  3. Run the page through whynopadlock.com or Qualys SSL Labs for external validation.
  4. Test your most important inner pages too — checkout, contact forms — not just the homepage.

For a complete reference of SSL errors and their solutions, visit our SSL security guide.

Key Takeaways

  • Mixed content splits into passive (images, video) and active (scripts, styles); browsers block active mixed content entirely.
  • The DevTools Console is your first diagnostic tool — it shows the exact URL of every offending resource.
  • The permanent fix is updating all http:// references to https:// in code and database.
  • The upgrade-insecure-requests CSP directive is a temporary patch, not a permanent solution.
  • On WordPress, Better Search Replace and Really Simple SSL automate much of the process.
  • Always verify the result with DevTools and an external tool before closing the ticket.

Dealing with persistent mixed content errors you can not track down? The team at elenlace.com can audit and fix your site — reach out today.

FAQ

Does mixed content affect Google rankings?

Google has not confirmed a direct ranking penalty for mixed content. However, losing the padlock damages user trust, increases bounce rate, and can indirectly hurt SEO. Active mixed content also breaks site functionality when browsers block it.

Why do mixed content errors appear after installing SSL?

Because the certificate secures the server connection but does not automatically rewrite URLs already hardcoded as http:// in your code or database. You must update those references manually or with a search-and-replace tool.

Is upgrade-insecure-requests enough?

Not long-term. It works as a transitional measure, but if an external resource genuinely does not serve HTTPS, the browser will show a connection error instead. The right fix is correcting the URLs at the source.

How do I prevent mixed content in the future?

Always use relative URLs (/path/to/resource) or absolute HTTPS URLs when adding images, links, or scripts. Make sure your CMS site URL setting is configured with https:// from the start so all generated links inherit the correct protocol.

Compare providers

Other providers and guides worth comparing:

← All