Fixing Mixed Content: That ‘Not Secure’ Warning on Your HTTPS Pages

When the little padlock in the browser’s address bar goes gray and the console spits out a row of “Mixed Content” warnings, it means HTTP resources have snuck into your HTTPS page, and the whole page’s security status gets knocked back to partially encrypted. Leave this unfixed and you might as well not have HTTPS at all — users see the “Not Secure” warning and bounce, and Google treats mixed-content pages as a downgrade signal, hurting both rankings and conversions.

The most typical case I’ve seen was an ecommerce site that went full HTTPS but conversions didn’t go up. On investigation, over 200 images on product detail pages were hardcoded as http://, so browsers marked the whole page as “Not Secure” — even the add-to-cart button wouldn’t work. Mixed content isn’t a “it runs, so it’s fine” minor issue. It directly eats away at user trust and search rankings, and it has to be cleaned up systematically — not by changing a few images and calling it done.

Here’s the bottom line up front: mixed content knocks the whole page’s security status back to partially encrypted, hurting both HTTPS ranking benefits and user trust — don’t put it off. Locate everything using a three-tool combo: DevTools console, server-side crawler logs, and a site-wide scanner. Grab the full list before making changes, don’t fix by gut feel. For fixes, prioritize “change the protocol” to keep functionality working; for external resources that can’t be changed, use CSP’s upgrade-insecure-requests directive as a safety net. After launch, re-scan with curl or a site-wide crawler and confirm zero mixed-content warnings — that’s when you’re truly done.

How mixed content gets in

The most common source is templates or legacy rich-text content with hardcoded http:// images, scripts, iframes, and fonts. CMS migrations, CDN domain changes, third-party widget upgrades — all of these can bring in old protocols, and often one change contaminates hundreds or thousands of pages. Another category is HTTP redirect chains: the resource itself is available over HTTPS, but the chain first redirects to HTTP then back to HTTPS, and browsers still flag it as mixed content.

An easily overlooked point: even if there’s just one HTTP sub-resource on the page, the whole page isn’t “fully secure,” and the padlock won’t turn green. So the fix target is “not a single one left,” not “most of them are changed.” That’s also why you have to use tools to scan the full site — eyeballing source code will definitely miss things. You never know which corner still hides an HTTP image, and by the time a user screenshots it and complains, it’s too late.

Three steps to locate all mixed content

Step one: Chrome DevTools Console lists each Mixed Content URL individually, down to the file and line number — great for real-time single-page debugging, and you can catch issues during development. Step two: filter server-side access logs or crawler logs for scheme=http requests — this shows resources that were actually triggered, including ones that only load under specific interactions or in specific regions. Step three: run a site-wide scanner with an “insecure content” dimension and export an actionable list.

Each tool has blind spots: the console only covers the current page, logs only record resources that were “requested,” and scanners may miss resources injected purely by JS. So don’t rely on a single method — merge and deduplicate the three lists, and that’s your true full inventory, and you can proceed with confidence. The table below shows how the three tools divide the work — use it to build your own debugging流程.

Four Steps to Fix Mixed ContentLocateConsole + logs + scannerFix protocolhttp→https or // relativeCSPupgrade-insecure safety netVerifyRe-scan to zero after launch

Figure: Key points for fixing mixed content (compiled by 运营GO)

Tool Good at Blind spot
Chrome Console Real-time single page, precise to line Can’t scan whole site
Server crawler logs Real requests, includes third-party Can’t catch untriggered resources
Site-wide scanner Full inventory, exportable list May miss purely dynamic loads

Two main lines of attack for fixes

Line one: change resource URLs to https. Images, JS, and CSS are the easiest to fix — after changing, confirm the resource returns 200 normally over HTTPS and the certificate is valid. If you want to be lazy, you can use protocol-relative addresses like //cdn.x.com/a.js, and the browser automatically matches the page protocol — this has pitfalls when debugging locally with file://, but it’s fine in production. Just make sure internal links aren’t hardcoded as http either.

Line two: for external HTTP resources that can’t be removed, download and host them on your own HTTPS domain if possible; if localization really isn’t an option, add Content-Security-Policy: upgrade-insecure-requests to the response headers, so the browser automatically upgrades sub-requests to HTTPS before sending. For the part that fails to upgrade, use CSP report-only mode to send reports to a monitoring endpoint — at least you can see what’s still slipping through. For a more complete explanation of certificates and HSTS, read the Technical SEO Handbook; mixed content also wastes crawl budget, see crawl budget optimization.

How to verify after launch

Don’t ship right after changing things. First use curl -I on a few key pages and check whether all sub-resources are HTTPS; then run a site-wide crawler scan — the exported mixed content list should be zero items. Just checking the homepage isn’t enough. You need to cover detail pages, checkout pages, and other places with the densest sub-resources — those are the real hotspots for mixed content, and also where users are most likely to give up.

Google Search Console’s “HTTPS report” reflects the status — check back every day or two to confirm no new warnings. If the report still shows mixed content, it means dynamically loaded resources slipped through — go back to the three-tool locating combo and fill the gaps. After verification passes, turn off CSP report-only and switch to enforce mode. Don’t stay in report-only (report but don’t block) long-term — that just hides the problem.

Three most common pitfalls

Pitfall one: only fixing the homepage and ignoring detail pages. Many sites have a statically generated homepage with no mixed content, but detail pages are dynamically rendered from templates, and HTTP images hide in the templates — your scan must cover the whole site, not just the homepage. Pitfall two: thinking upgrade-insecure-requests solves everything — this directive only upgrades requests that “can succeed,” and when an external resource has no HTTPS version, it still fails. You have to pair it with report-only monitoring to see what’s happening.

Pitfall three: not verifying after changes, shipping on “it should be fine,” and then GSC reports mixed content again a week later. Write verification into the release流程 as a mandatory step, and make “mixed content list is zero” a launch gate — that’s how you avoid repeating the cycle. This gate, along with your overall crawling strategy, can be folded into the Technical SEO Handbook’s release standards, so every site change automatically passes this check.

Next action items

  • Today, open your top 5 highest-traffic pages one by one in DevTools Console and record all Mixed Content URLs.
  • Categorize those URLs into three groups: “protocol can be changed,” “needs localization,” “must use CSP upgrade,” and handle each accordingly.
  • Add Content-Security-Policy: upgrade-insecure-requests to response headers, start with report-only for a week, then enforce.
  • Run a site-wide scanner and export the mixed content list — target is zero.
  • After a week, check GSC’s HTTPS report to confirm no new warnings, then switch to enforce mode.
Popular Tags
Scroll to Top