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.
How mixed content manifests:
Common causes of mixed content:
Use these methods to find problematic resources:
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.
Prevent mixed content with these practices:
Indirectly yes. Google prefers fully HTTPS sites. Also, blocked resources can break your site and increase bounce rate.
Not recommended. Browsers block more and more mixed content. What works today may be blocked tomorrow.
Use a plugin like Better Search Replace to replace http:// with https:// in the database. Also check the theme and plugins.
Host the resource locally on your server, or find an HTTPS alternative.
Passive content (images) is less dangerous than active (scripts) but still compromises the privacy and integrity of your page.
MoniTao monitors SSL certificate validity. For mixed content, use specialized tools like whynopadlock.com.
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.
Start free, no credit card required.