Adding a valid TLS certificate does not finish an HTTPS migration. Whenever an https:// page still references even one script, stylesheet, iframe, form action, or image over plain http://, browsers flag the page as mixed content.
Depending on the asset type, visitors either hit silently broken navigation/checkout flows or see a "Not Secure" indicator in the address bar — while basic uptime checks keep reporting HTTP 200.
Active vs. Passive Mixed Content
The W3C Mixed Content specification splits insecure subresources into two groups:
- Active mixed content (blocked outright):
<script src="http://...">,<link rel="stylesheet" href="http://...">,<iframe src="http://...">,<object>,<embed>, and<form action="http://...">. Chrome, Firefox, Safari, and Edge block these requests completely because an active network attacker could modify the response in flight and take over the DOM. - Passive mixed content (autoupgraded or Not Secure):
<img src="http://...">,<audio>,<video>, and<source>. Browsers try to autoupgrade passive image/media URLs tohttps://and break them if the remote host has no valid TLS certificate, or downgrade the trust indicator.
Why Mixed Content Keeps Coming Back on WordPress
After switching a WordPress or WooCommerce site to HTTPS, four places regularly keep hardcoded http:// links alive:
- Serialized page-builder metadata: Elementor, Divi, and WPBakery store image and CSS URLs inside serialized PHP arrays in
wp_postmetaandwp_options. Running a plain SQLREPLACE()corrupts serialized string lengths; use WP-CLI instead. - Generated upload CSS caches: Page-builder CSS files under
wp-content/uploads/keep oldhttp://URLs until you regenerate CSS and purge page caches. - Hardcoded child-theme tags: Legacy
header.phporfooter.phptemplates loadinghttp://fonts.googleapis.comor older vendor scripts. - Missing reverse-proxy proto headers: If Nginx or a load balancer terminates TLS without forwarding
X-Forwarded-Proto: https, PHP emitshttp://asset links viawp_enqueue_script.
Clean Database Replacement with WP-CLI
Take a database backup first, preview with --dry-run, and keep guid untouched:
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 Add upgrade-insecure-requests and HSTS at the Server Layer
Once the origin HTML is clean, add a Content-Security-Policy safety net so leftover third-party http:// references upgrade automatically:
# 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; # Apache / .htaccess <IfModule mod_headers.c> Header always set Content-Security-Policy "upgrade-insecure-requests" Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains" </IfModule> Auditing Third-Party Script Hosts & Subresource Integrity (SRI)
Every external <script src="https://..."> executes inside your visitor's browser with the same DOM access as your first-party application code. Three habits cut client-side supply-chain risk dramatically:
- Inventory every external script and iframe host and remove abandoned marketing pixels from past campaigns.
- Pin SHA-384
integrityattributes (SRI) on static, versioned CDN libraries (cdnjs,jsdelivr,unpkg) so a tampered file fails to execute. (Skip static SRI hashes on dynamic, unversioned vendor loaders like Tag Manager or Stripe.js.) - Alert when a script loads from a new host: On a healthy production site, brand-new external script domains only appear after an intentional deploy. Catching an unfamiliar host overnight gives you immediate evidence of a compromised plugin or injected skimmer.
Test Any Public HTTPS Page Right Now (No Login, Zero Storage)
We built a free, zero-storage Mixed Content & Third-Party Script Checker that runs one passive read from our EU server and returns:
- Active vs. passive
http://mixed content counts and examples - Distinct third-party script and iframe host inventory plus missing SRI counts
- OWASP security headers (
HSTS,CSP,X-Content-Type-Options,X-Frame-Options,Referrer-Policy) - Copy-paste WP-CLI, Nginx, Apache, and Cloudflare fixes
(Originally published in full on the Beamfar Mixed Content & Third-Party Script Security Guide.)
