Diagnosing and Fixing Mixed Content Warnings
What causes mixed content warnings after moving to HTTPS, how to find them in the browser console, and the practical fixes for each common cause.
2 December 2026 5 min read
You’ve forced HTTPS, the certificate is valid, and the browser still shows a “not fully secure” warning or a padlock with a warning triangle. This is almost always mixed content: your page loaded securely, but something inside it is being fetched over plain HTTP. Here’s what causes it, how to find it, and how to fix it properly rather than papering over it.
What Mixed Content Actually Is
Mixed content happens when an HTTPS page requests a sub-resource, such as an image, script, stylesheet, font, or iframe, over plain HTTP instead of HTTPS. The top-level page is secure, but part of what it loads isn’t, which undermines the whole point of the padlock: an attacker on the network path could tamper with that insecure resource even though the page itself is protected.
Browsers distinguish between two categories:
- Passive (or “display”) mixed content: things like images, video, and audio. These can’t directly interfere with the rest of the page. Modern browsers (Chrome, Firefox, Edge, Safari) now automatically try to upgrade these requests to HTTPS first: if the HTTPS version exists, it loads with no warning at all, and if it doesn’t, the resource simply fails to load rather than silently falling back to plain HTTP.
- Active mixed content: things like scripts, stylesheets, iframes, and fetch/XHR requests. These can manipulate the page’s behaviour, so modern browsers block them outright by default rather than just warning.
Active mixed content is the more urgent problem: a blocked script can silently break page functionality, not just show a warning icon.
Finding It in the Browser Console
Every major browser reports mixed content in its developer tools console. Open it (F12, or right-click and Inspect, then the Console tab) and reload the page. Look for messages along the lines of:
Mixed Content: The page at 'https://example.com/' was loaded over HTTPS,
but requested an insecure image 'http://example.com/images/logo.png'.
This content should also be served over HTTPS.
Each warning or error names the exact insecure URL and the type of resource, which is usually enough to go straight to the source in your HTML, CSS, or database. The Network tab is also useful here: filtering requests and sorting by scheme, or just scanning for entries starting with http:// rather than https://, will surface anything the console message alone doesn’t make obvious, including resources loaded by third-party scripts.
Common Causes
- Hardcoded http:// URLs in page content. Images or links pasted into a CMS years ago, before the site had HTTPS, often still point at http://. This is extremely common in WordPress, where post content, widget text, and theme options can all contain absolute http:// URLs stored directly in the database.
- Theme or plugin assets hardcoded to http://. Older or poorly maintained themes and plugins sometimes enqueue scripts or stylesheets with a hardcoded http:// prefix instead of a protocol-relative or HTTPS URL.
- Third-party embeds and widgets. Old embed codes for things like social widgets, ad tags, or video players sometimes still specify http://, especially if they were copied from an old tutorial.
- External CDNs or asset hosts that don’t support HTTPS. Rare today, but it happens with abandoned or self-hosted resource domains.
- Site URL settings themselves. In WordPress, the siteurl and home options can still be set to http:// even after the server is serving HTTPS, which causes WordPress to generate insecure links throughout the site.
Fixing Hardcoded Content URLs
For content stored in a database, such as WordPress posts, the fix is a search-and-replace across the content, changing http://example.com to https://example.com. Do this carefully: a blunt text find-and-replace on raw database exports can corrupt serialized PHP data if any of it contains string-length prefixes, which WordPress uses in places like widget settings and theme options. Use a tool built for the job (for example WP-CLI’s search-replace command, which understands serialized data) rather than a plain SQL REPLACE() or a text editor, and always take a full database backup first.
wp search-replace 'http://example.com' 'https://example.com' --all-tables
Also check the site’s core URL settings, under Settings > General in the WordPress admin, to confirm both the WordPress Address and Site Address use https://.
Fixing Theme, Plugin, and Third-Party References
For hardcoded references in theme or plugin code, edit the source to use https:// directly. If a third-party script or widget genuinely has no HTTPS version available, the honest options are to remove it or replace it with an alternative that does support HTTPS; there isn’t a safe workaround for embedding a resource that can’t be served securely. Routing such assets through a CDN that enforces HTTPS on every request is another way to close this gap if you cannot change the source directly.
A Stopgap: Content-Security-Policy Upgrade-Insecure-Requests
Browsers support a Content-Security-Policy directive that automatically rewrites insecure sub-resource requests to HTTPS before they’re sent, which can mask the symptom while you work through the underlying causes:
Content-Security-Policy: upgrade-insecure-requests
Treat this as a safety net, not a fix. It only helps if the resource is actually reachable over HTTPS at the same path; if the http:// only host has no valid HTTPS listener at all, the request will simply fail rather than succeed insecurely, which can break the page in a different way. Find and correct the actual source URLs rather than relying on this long term.
Summary
Mixed content means part of an otherwise secure page is still being loaded over plain HTTP. Find it with your browser’s console and network tab, which will name the exact insecure URL. Passive content like images gets a warning; active content like scripts gets blocked outright, so treat that as the priority. Fix the actual source, whether that’s database content, theme code, or a stale third-party embed, using tools that handle serialized data safely rather than a blunt find-and-replace, and keep the CSP upgrade-insecure-requests header as a temporary safety net at most.