Mixed content warnings: how to find and fix HTTP assets on HTTPS pages
Mixed content happens when an HTTPS page loads images, scripts or styles over HTTP. How browsers treat it, how to find every offender, and how to fix it in HTML, WordPress and your server.
· 6 min read · By the Spot Downtime team
You installed a valid certificate, the site loads over HTTPS, and yet the padlock is missing or a script does not run. The usual reason is mixed content: the page itself came over HTTPS, but it pulls in at least one resource over plain HTTP.
Browsers treat this as a security problem, because an attacker on the network can tamper with anything loaded over HTTP, and that content runs inside your secure page.
Two kinds of mixed content
- Active mixed content: scripts, stylesheets, iframes, fetch and XHR requests, fonts. Modern browsers block these outright. The symptom is a broken feature: a menu that does not open, a missing map, a form that does nothing.
- Passive mixed content: images, audio and video. Browsers have been moving toward upgrading these to HTTPS automatically, and loading them over HTTP if the upgrade fails may be blocked or flagged. Either way the page is marked as not fully secure.
Behavior differs slightly between browsers and versions, so do not rely on a given file being tolerated. Fix all of them.
Step 1: find the offending URLs
Open the page in Chrome or Firefox, open DevTools, and look at the Console. Each blocked or flagged request is logged, with a message like:
Mixed Content: The page at 'https://example.com/' was loaded over HTTPS,
but requested an insecure script 'http://cdn.example.com/app.js'.
This request has been blocked; the content must be served over HTTPS.The Network tab also helps: filter by http: in the search box to list every insecure request on that page. Do this on a few page types, not just the home page, since templates for blog posts, product pages and checkout often differ.
To check many pages from the command line, search the HTML you serve for hard-coded http:// references:
curl -s https://example.com/ | grep -oE '(src|href|action)="http://[^"]+"' | sort -uThat only sees the initial HTML. Resources added by JavaScript, or referenced from inside CSS, will not show up, so confirm in the browser as well. For a whole site, a crawler or a site-wide search of your database and templates is more reliable.
Step 2: fix the source
Hard-coded URLs in your templates
Change http:// to https://. If the third-party host supports HTTPS (nearly all do), that is the whole fix. Avoid protocol-relative URLs like //cdn.example.com/app.js in new code. They worked as a transition trick, but a plain https:// is clearer and safer.
<!-- before -->
<script src="http://cdn.example.com/app.js"></script>
<img src="http://example.com/uploads/logo.png">
<!-- after -->
<script src="https://cdn.example.com/app.js"></script>
<img src="/uploads/logo.png">For your own files, a root-relative path such as /uploads/logo.png always uses the page's scheme.
WordPress
The most frequent cause on WordPress is old content saved with http:// URLs in the database, often from before the site moved to HTTPS. First confirm that Settings > General has both the WordPress Address and Site Address set to https://. Then update stored URLs with WP-CLI, doing a dry run first and taking a backup:
wp search-replace 'http://example.com' 'https://example.com' --dry-run
wp search-replace 'http://example.com' 'https://example.com' --skip-columns=guidThemes and plugins can also hard-code HTTP URLs. If the console names a file inside a plugin folder, that plugin is the culprit.
Content in a CMS or database
Rich text editors store absolute URLs in the content. Run a search-and-replace on the content table, or use the CMS's bulk edit tools. Test on a copy first, since a careless replace can also change links that you intended to keep as HTTP.
Behind a proxy or CDN
If the app generates absolute URLs and sits behind a load balancer that terminates TLS, it may believe the request was HTTP and emit http:// links. The fix is to pass the original scheme and make the app trust it. In nginx:
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;Then configure your framework to honor X-Forwarded-Proto (for example Express's trust proxy setting, or Django's SECURE_PROXY_SSL_HEADER).
Step 3: add a safety net
Two headers can help while you clean up, and afterwards as protection against regressions.
- Content-Security-Policy: upgrade-insecure-requests tells the browser to rewrite
http://subresource URLs tohttps://before requesting them. It works only if the host actually serves the resource over HTTPS. - Strict-Transport-Security (HSTS) makes browsers use HTTPS for your domain going forward. Enable it only once all your subdomains and assets work over HTTPS, because it is hard to undo quickly.
add_header Content-Security-Policy "upgrade-insecure-requests" always;
add_header Strict-Transport-Security "max-age=31536000" always;upgrade-insecure-requests is a patch, not the fix
Mixed content checklist
- Load the page and read the console for “Mixed Content” messages.
- Filter the Network tab for
http:. - Update hard-coded URLs in templates, CSS and JavaScript.
- Search and replace stored URLs in the database.
- Pass
X-Forwarded-Protoif a proxy terminates TLS. - Check the other page types: checkout, login, embeds and old posts.
- Add
upgrade-insecure-requestsas a safety net, then consider HSTS.
Related checks
Mixed content is separate from certificate problems such as an expired certificate or an incomplete chain, but they often appear together after a migration. After a fix, check the certificate and the headers you return:
Security headers checkerCheck whether your site sends HSTS and a Content-Security-Policy.SSL checkerConfirm the certificate is valid and the chain is complete.Get new guides by email
Practical posts on monitoring, outages, error fixes and on-call, when they're published. No spam.
Keep reading
- SSL · TroubleshootingCertificate pinning and rotation: how to renew without breaking your appsPinned certificates turn a routine renewal into an outage for mobile apps and API clients. How to pin the public key, plan backup pins and rotate safely.November 9, 2026 · 7 min read
- SSL · TroubleshootingHSTS explained: how to enable it, and how to undo it when it locks you outWhat the Strict-Transport-Security header does, how to roll it out safely, why browsers show an error with no bypass button, and how to remove HSTS or the preload list.November 7, 2026 · 7 min read