Mixed Content Errors: Why the Padlock Disappears and How to Fix It
What mixed content is, why browsers block some http files on https pages, and a step-by-step way to find and fix every insecure request.

You install a certificate, switch the site to https, and the padlock still does not appear. Or it appears, but a slider stops sliding and an embedded map turns into a grey box. The cause is nearly always mixed content: a secure page that still asks for some of its files over plain http.
Why browsers care
https protects the whole conversation between a visitor and your server. If the page itself is encrypted but a script is not, anyone on the same network could swap that script for their own and take over the page. Browsers therefore treat insecure requests on a secure page as a serious problem.
They split them into two groups. Active content, meaning scripts, stylesheets, frames, objects and data requests, can change the entire page, so browsers block it outright. Passive content, meaning images, audio and video, can only change what it displays, so current browsers try to load it over https automatically and block it only if that fails. A form that posts to an http address is a third case: the page loads fine, but the browser warns before sending anything.
Where insecure URLs come from
Most mixed content dates from before a site moved to https. Old posts contain images pasted with full http addresses. A theme loads a font or library from a fixed http URL. A plugin writes an http link into the page header. Embedded widgets copied from a partner years ago still point to their old addresses. CSS files reference background images with http in a url() call.
Finding every one
The browser console lists mixed content warnings, but only for the page you are on, and only after the page loads. Reading the source is more thorough. Paste the page source into the Mixed Content Checker and Fixer and it lists each http reference with its line number, tag, attribute and whether it would be blocked, upgraded or merely warned about. It looks inside srcset lists, style attributes, style blocks, @import rules, form actions, meta refresh tags and strings inside inline scripts, the places that a quick search for src= tends to miss.
Start with the active items, because those are what break features. Then deal with forms, because those leak data. Passive items come last; they mostly work already but still cost you the clean padlock in older browsers.
Checking hosts before rewriting
Changing http to https only works if the other server supports https. For each host in the list, open it with https in a new tab. Big CDNs and font services all do. Small partners sometimes do not. If a host fails, either download the file and serve it from your own domain or look for a replacement. The checker lets you list such hosts so they are left alone during the rewrite.
Applying the fix
Once you know which URLs are safe to change, the tool rewrites them and can add a meta tag that tells the browser to upgrade any remaining http requests automatically. The same instruction can also be sent as a response header, which covers every page on the site at once. The header is the more reliable choice for large sites, because it catches URLs you have not scanned, including ones built by JavaScript.
For a content management system, fix the source rather than only the output. Search the database for http://yourdomain and replace it with https://, update theme files and plugin settings, and clear any page cache afterwards.
After the switch
Reload the real page with the console open and confirm there are no mixed content warnings left. Then consider adding HSTS, which tells browsers to use https for your domain every time. Add it only after every subdomain works over https, because browsers remember the setting for months.
Mixed content is one of the few web problems that can be fixed completely. A careful pass through templates, one header and a final console check is usually all it takes.



