Mixed content occurs when a page delivered over HTTPS requests subresources over insecure HTTP. Browsers split it into two classes: active content such as scripts, stylesheets and iframes, which is blocked, and passive content such as images, audio and video, which browsers now generally upgrade to HTTPS or block.
Why it matters
An attacker on the network can alter an insecure script and take over the whole page, which cancels the benefit of HTTPS. Blocked resources also cause visible breakage: missing layouts, broken sliders, absent fonts, and a console message such as "Mixed Content: The page was loaded over HTTPS, but requested an insecure script".
It tends to appear after a migration to HTTPS, when old posts, theme settings or database content still contain hard-coded http:// URLs.
Example
Find offenders and fix the source rather than relying on a patch:
grep -rn "http://" wp-content/themes/mytheme/
Use protocol-safe or relative URLs, and as a safety net add:
Content-Security-Policy: upgrade-insecure-requests
This asks browsers to rewrite insecure subresource URLs to HTTPS, which only works if the HTTPS version exists.
Common mistakes
- Relying on
upgrade-insecure-requestswhile the third-party host has no HTTPS. - Fixing templates but leaving old database content untouched.
- Forgetting CSS
url()references and inline scripts.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.