Beamfar

How to fix HTTPS mixed content and audit third-party JavaScript hosts

A valid TLS certificate does not finish an HTTPS migration by itself. When a page served over https:// still embeds even one script, stylesheet, iframe, form action or image over plain http://, browsers classify the page as mixed content. Depending on the resource type, the visitor either sees broken layouts and silent checkout failures or a “Not Secure” indicator in the address bar.

Just as importantly, the exact same HTML inventory that exposes mixed content also exposes every third-party JavaScript and iframe host executing inside your visitors’ browsers. On agency-managed WordPress, WooCommerce and SaaS sites, unexpected third-party script hosts are one of the clearest outside signals of a compromised plugin, a supply-chain tag compromise or a payment skimmer.

Active vs. passive mixed content: what browsers actually do

The W3C Mixed Content specification splits insecure subresources into two categories because they carry very different risk profiles:

  1. Active mixed content (blockable): <script src="http://...">, <link rel="stylesheet" href="http://...">, <iframe src="http://...">, <object data="http://...">, <embed src="http://...">, XMLHttpRequest/Fetch calls and <form action="http://...">. Because an active network attacker can modify JavaScript or CSS in flight and take over the entire DOM, Chrome, Firefox, Safari and Edge block active mixed content outright. A single hardcoded http:// stylesheet or checkout script can break navigation menus, cart buttons or payment embeds without triggering a server error.
  2. Passive mixed content (optionally blockable / autoupgraded): <img src="http://...">, <audio src="http://...">, <video src="http://..."> and <source src="http://...">. Modern browsers attempt to autoupgrade passive image and media URLs to https:// and fail to load them if the remote host does not answer on HTTPS — or downgrade the address-bar trust indicator when insecure media slips through.

In both cases, standard uptime pings stay green because the HTML document itself returns HTTP 200. You only catch the failure if you inspect the HTML assets from outside or crawl pages regularly.

Check it now. The mixed content & third-party script checker detects insecure http:// scripts, stylesheets, iframes and images on HTTPS pages, inventories third-party script and iframe hosts, checks SRI attributes and builds copy-paste HTTPS upgrade fixes; the security headers checker reads a page’s HSTS, CSP, X-Content-Type-Options, frame protection, Referrer-Policy and Permissions-Policy. No account, and the address is not stored.

Why mixed content survives on WordPress and WooCommerce sites

After installing Let’s Encrypt or moving behind Cloudflare, teams often update the Site Address (URL) setting in WordPress and assume the job is done. Four places quietly keep hardcoded http:// references alive:

  • Serialized page-builder options: Elementor, Divi, WPBakery and custom theme options store CSS background URLs and widget links inside serialized PHP arrays in wp_postmeta and wp_options. A naive SQL REPLACE() breaks serialization lengths and wipes out layouts; use WP-CLI search-replace instead because it deserializes and recalculates string lengths cleanly.
  • Cached CSS bundles: Page-builder CSS files generated under wp-content/uploads/ retain the old http:// base URL until you regenerate CSS and purge page caches.
  • Legacy theme templates and hard-coded embeds: Older child themes frequently include http://fonts.googleapis.com or http:// vendor scripts directly in header.php or footer.php.
  • Reverse proxy headers: When Nginx, Cloudflare or a load balancer terminates TLS in front of PHP, WordPress may think the incoming request is plain HTTP unless HTTP_X_FORWARDED_PROTO is forwarded properly, causing wp_enqueue_script to emit http:// asset URLs.

Step-by-step fix across WordPress, Nginx, Apache and Cloudflare

Fix hardcoded http:// references at their source first, then add HTTP response headers as a safety net so future content edits cannot reintroduce mixed content.

1. Replace hardcoded URLs in WordPress safely with WP-CLI

Always take a verified database backup first, run a --dry-run to inspect affected tables, and skip the guid column (RSS feeds rely on immutable GUIDs):

wp search-replace 'http://example.com' 'https://example.com' --all-tables --dry-run
wp search-replace 'http://example.com' 'https://example.com' --all-tables --skip-columns=guid
wp cache flush

Regenerate page-builder CSS files (for example Elementor -> Tools -> Regenerate CSS & Data) and confirm define('FORCE_SSL_ADMIN', true); is set in wp-config.php.

2. Add CSP upgrade-insecure-requests and HSTS in Nginx or Apache

The Content-Security-Policy: upgrade-insecure-requests directive instructs browsers to rewrite remaining http:// subresource requests to https:// automatically before sending them over the wire. Combine it with Strict-Transport-Security (HSTS) once every subdomain is verified on HTTPS:

# Nginx (inside your HTTPS server block)
add_header Content-Security-Policy "upgrade-insecure-requests" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;

On Apache / .htaccess with mod_headers:

<IfModule mod_headers.c>
  Header always set Content-Security-Policy "upgrade-insecure-requests"
  Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
</IfModule>

On Cloudflare, turn on Always Use HTTPS and Automatic HTTPS Rewrites under SSL/TLS -> Edge Certificates, while still cleaning database URLs so origin HTML remains valid if DNS ever bypasses the proxy.

Auditing third-party JavaScript hosts and Subresource Integrity

Mixed content is only half of client-side page hygiene. Every external <script src="https://..."> tag you embed executes with the same JavaScript privileges as your own application code — reading form fields, mutating checkout buttons and accessing non-HttpOnly cookies.

Use a simple three-point review on every production site you manage:

  1. Maintain a known-host inventory: List every distinct external host serving scripts or iframes (analytics, chat widgets, payment SDKs, consent banners, CDNs). Remove dead marketing pixels from past campaigns — orphaned third-party domains are frequent targets for domain re-registration takeovers.
  2. Use Subresource Integrity (integrity=) for static CDN libraries: Whenever you load a versioned library from a public CDN (cdnjs, jsdelivr, unpkg), pin a SHA-384 integrity hash and crossorigin="anonymous" so a compromised CDN file fails to execute. Dynamic tag managers cannot use static SRI hashes, which makes least-privilege CSP script-src rules and external host monitoring even more important.
  3. Baseline and watch for new external hosts: A clean site rarely adds a brand-new script domain outside a planned deploy. If an external scanner observes a script or iframe loading from an unfamiliar host overnight, you have concrete evidence to investigate immediately — the exact page URL, the new host name and when it first appeared.

How to check any page right now and monitor continuously

You can audit any public HTTPS page immediately with our free zero-storage mixed content & third-party script checker. It fetches the page once from our EU server, separates active and passive http:// references, inventories every external script and iframe host, reports missing Subresource Integrity attributes and builds copy-paste fixes without storing your URL.

For ongoing protection across a full client portfolio, Beamfar combines scheduled site crawls (flagging broken links and mixed content across pages) with external security checks from the Solo plan upward. The first scan establishes your baseline of expected script and iframe hosts; later scans send a grouped alert whenever a script from a new host, hidden spam link or missing security header appears — alongside multi-region uptime, SSL expiry, DNS change detection and white-label monthly client PDF reports.

Frequently asked questions

Q: Does upgrade-insecure-requests fix broken third-party http:// assets if the remote server has no HTTPS?

A: No. upgrade-insecure-requests tells the browser to request the https:// version of the URL. If the external server does not support valid HTTPS on that host, the browser request still fails — you must replace or self-host that asset.

Q: Why does a page show zero mixed content in raw HTML but still warn in Chrome DevTools?

A: Some scripts dynamically inject http:// images, fonts or XHR calls after page load, or CSS files reference url("http://...") backgrounds. Fix the raw HTML first with our checker, then inspect the Network tab in Chrome DevTools filtered by scheme:http and verify your site-wide crawl.

Q: Should every third-party script have a Subresource Integrity (integrity) attribute?

A: Use SRI for immutable, version-pinned libraries served from public CDNs. Do not add static SRI hashes to unversioned dynamic endpoints (such as Google Tag Manager or Stripe.js) whose contents update continuously, because the browser will block them as soon as the vendor ships an update.

Q: Can Beamfar monitor multiple pages on a site for mixed content and unexpected external scripts?

A: Yes. Beamfar’s site crawler inspects internal pages for mixed content, broken links and redirect loops, while external security checks baseline your expected script and iframe hosts and alert when a script appears from a new host.

Sources

Read on . Standards and vendor pages change; confirm the current text before you rely on it.

Terms used in this guide

  • TLS certificateA TLS certificate proves a website holds the name in the address bar and enables HTTPS. What it contains, how long it lasts, what expiry breaks.
  • HSTSHSTS is a response header telling browsers to use only HTTPS for a site. What max-age and includeSubDomains do, and why an expired certificate then hurts.
  • Redirect chainA redirect chain is a sequence of redirects between the first URL and the final page. How many hops Google follows and why to collapse chains to a single hop.
  • Uptime monitoringUptime monitoring requests a website from outside at intervals and alerts when it fails to answer. What it measures, what it misses and how it is confirmed.

Try it on your own sites.

Add your sites: checking starts as soon as you do.

No card for the Free plan.