Mixed Content Errors and How to Fix Them

An HTTPS page has mixed content when it tries to load a resource, such as a script or image, over an insecure connection. The browser may upgrade some requests to HTTPS and block others. An automatically upgraded image may display correctly even though the page still references an HTTP URL, while a blocked script or API request can break a feature. Fix the reference after confirming that the resource is available securely, or remove the resource if it is no longer needed.
Begin with the browser's console and Network panel on the affected page. Capture the page URL, resource URL, resource type, initiating element or script, and the final request result. Test in a supported browser and a realistic environment; do not make the page appear fixed by globally allowing insecure content.
Locate the Insecure Request
Load the HTTPS page with developer tools open and read each mixed content warning. The console can identify a URL that the browser upgraded or blocked. In the Network panel, filter by the resource name and inspect the request scheme, status, initiator, and redirect chain. The insecure reference may come from a stylesheet, template, embedded frame, tag manager, third-party widget, or content stored in a publishing system.
Search the site's editable source and content for the exact http:// URL and its host. Also inspect generated HTML, CSS url() values, JavaScript fetch calls, image variants, and download links. A resource can be inserted after initial page load, so repeat the action that triggers the error. Record every occurrence before changing a shared asset or component, because one URL may serve several pages.
Check every warning, even if the page looks normal. One image may load successfully while a blocked API call prevents a button from working. Inspect alternate image sizes and the URLs selected through srcset attributes or picture elements, since the browser can request a different file at another window size.
Classify Upgraded and Blocked Resources
Browsers divide mixed content into requests they can upgrade and requests they block. Ordinary image requests from an img element's src attribute, along with audio and video requests, can be upgraded from HTTP to HTTPS. The server must provide the resource at that HTTPS address; otherwise the load fails. An otherwise upgradable image URL with a public IP address as its host is blocked instead of upgraded.
Images selected through srcset attributes or picture elements are treated as blockable mixed content rather than receiving that automatic upgrade. CSS background images can fall into the upgradable category, while web fonts and stylesheets are blockable. Identify how the resource is requested instead of classifying it only by its file extension.
Scripts, iframes, and API requests made with fetch or XMLHttpRequest are also blockable when an HTTPS page requests them over an insecure connection. A blocked script may stop a dependent feature, while a blocked API request can look like a generic network failure in application code. Downloads started from a secure page and fetched insecurely form a related risk; browsers may block them or warn the user. Treat those separately from subresource rendering.
Older descriptions of active and passive content do not fully describe these upgrade rules. Browser policies can change, so record the browser version and the element or API that made the request when diagnosing a difference between browsers.
Replace the URL and Secure the Endpoint
Open the resource's explicit HTTPS URL while testing the affected page. Confirm that the host has a valid certificate, the file exists, and its content is the expected resource. Then update the source reference to HTTPS or to an appropriate same-origin relative path. If the third-party provider offers no secure endpoint, replace the provider or remove the feature. Simply changing http:// to https:// in source cannot make an HTTP-only service secure.
Prefer an explicit known HTTPS URL over a protocol-relative URL such as //assets.example/file.js. A protocol-relative reference inherits the page scheme and can become HTTP when used from an HTTP context; it also hides the intended transport in source review. For first-party assets, make secure URLs the default in templates, configuration, content entry, and build output. Update hard-coded API endpoints to HTTPS and WebSocket connections to WSS where the service supports the corresponding secure endpoint.
For example, suppose a page requests http://assets.example/menu.js and the same script is available at https://assets.example/menu.js. Change the script reference in the template or component that generates it, then verify that the expected script loads and the menu works. Changing only the rendered element in developer tools does not update the saved source used by visitors.
The Content Security Policy directive upgrade-insecure-requests can help during a migration by rewriting insecure resource URLs before the browser requests them. Unlike ordinary mixed-content upgrades, the directive can also upgrade blockable resources such as scripts. A response header can enable it with Content-Security-Policy: upgrade-insecure-requests; if a target does not support HTTPS, the request fails without falling back to HTTP. Correct the underlying references and endpoints, and keep normal browser protections enabled for visitors.
Check Redirects and Final Destinations
Inspect the whole request chain after changing a resource URL. An HTTPS resource can redirect to HTTP, creating an insecure step even though the initial URL is secure. A redirect to another HTTPS host with an invalid certificate causes a different connection problem. Check that every required step uses HTTPS successfully and that the final resource has the expected content type and status.
Test assets behind authentication and error handling as well. An image request may succeed while a session is valid but receive a redirect to an insecure sign-in endpoint after the session expires. A server providing a third-party script may redirect requests differently by region or client version. Reproduce the intended states with safe test accounts and record the final URL and browser message for each. Fix the server or application setting that generates the insecure redirect.
Prevent Mixed Content from Returning
Retest pages after the change with the browser console and Network logs open. Include initial load, lazy-loaded sections, alternate image sizes, embedded content, and downloads. Verify that there are no unexpected HTTP subresource URLs, that required features still work, and that the application has not silently skipped a feature that still depends on an insecure resource.
Before publishing changes, check asset URLs in the generated pages and review the external providers used by templates. A crawl or source search can find obvious http:// references, while browser testing catches runtime-generated URLs and redirects. Keep the resource URL, page, browser version, environment, expected result, and observed result in the change record.







