Skip to content

What Is Mixed Content and How Do You Fix It?

A padlock that disappears or a script that never loads is often mixed content. Learn what it is, how to find the offending URLs and how to fix them properly.

10 min readUpdated Nov 21, 2026By XPASS Editorial Team

What Is Mixed Content and How Do You Fix It?

You install an SSL certificate, the site opens on HTTPS, and yet the padlock is missing, a warning appears, or part of the page simply does not show. A map is blank, a font falls back to a default, a contact form button does nothing. This is one of the most common problems after a site moves to HTTPS, and it has a name: mixed content.

Mixed content is not a certificate fault. Your certificate may be perfectly valid. The issue is that the page, which was delivered securely, asks for some of its parts over an insecure connection. This guide explains how browsers treat that, how to find every offending URL, how to fix the usual causes in a content management system or in plain code, and how to stop it coming back. If you are still deciding how visitors should reach your site, read how to force an HTTP to HTTPS redirect correctly alongside this article, because the two problems are related but not the same.

What mixed content means

A web page is rarely a single file. When your browser opens a page, it first fetches the HTML document and then makes many further requests: images, stylesheets, JavaScript files, fonts, videos, embedded frames and data calls made by scripts. Each of those requests has its own URL, and each URL has its own scheme, either https:// or http://.

The page is mixed when the document arrives over HTTPS but at least one of those sub-requests uses plain HTTP. The word "mixed" simply means that secure and insecure content are combined on one page.

Why does this matter? HTTPS protects data in transit with TLS, the protocol described in RFC 8446. It keeps third parties on the network from reading or changing what travels between the browser and the server. A plain HTTP request has no such protection. Anyone positioned on the path, for example on shared Wi-Fi or at a compromised network device, can read it or alter the reply. If the altered reply is a script that runs inside your secure page, the attacker effectively gains control of that page. That is the core reason browsers care.

Active and passive mixed content

Browsers divide the problem into two groups.

Type Examples Risk Typical browser behaviour
Active Scripts, stylesheets, iframes, fonts, data requests from scripts High: an attacker can change page behaviour Blocked
Passive (display) Images, audio, video Lower: content can be swapped, but it cannot run code Often upgraded to HTTPS or shown with a warning, depending on the browser

The exact behaviour differs between browser versions and changes over time, so do not treat the table as a promise. Treat it as a guide to priorities: fix active content first, because that is what usually breaks the page.

How to recognise it

Mixed content shows up in a few typical ways.

  • The padlock icon is replaced by a neutral or warning icon, or the address bar says the page is "not fully secure".
  • A part of the page is missing: a chat widget, an embedded map, a video, a font, a payment button.
  • Layout looks broken because a stylesheet was blocked.
  • The browser console prints messages such as "Mixed Content: The page was loaded over HTTPS, but requested an insecure resource", and names the exact URL.

The console is your best friend. In most desktop browsers you open developer tools, switch to the Console tab and reload the page. Each blocked or warned resource appears with its full URL. The Network tab is also useful: filter by the text http: to list requests that do not use HTTPS.

Step-by-step: finding every insecure URL

Do not just fix what you see on the home page. Mixed content hides in old blog posts, product descriptions and footers. Work through the following list.

  1. Check the key templates. Open the home page, a product or article page, the checkout or contact form, and the 404 page. Reload with the console open and note every mixed content message.
  2. Search the source. In your theme or code repository, search for http://. Not every hit is a problem, because links to other websites in an anchor tag are navigation, not resources. Focus on src=, href= inside link tags, url( in CSS, action= in forms and any script that builds URLs.
  3. Search the database. Content management systems store absolute URLs inside posts, widgets, custom fields and plugin settings. Search those tables for your old http://yourdomain and for any third-party http:// assets.
  4. Check third-party embeds. Ads, analytics snippets, maps and social widgets are common culprits. Many providers support HTTPS today; open their current embed code and copy it again.
  5. Check CSS and JavaScript files. A stylesheet that references http:// background images or fonts creates mixed content even if the HTML is clean. The same goes for scripts that call an http:// API.
  6. Use a crawler. For a large site, a crawling tool that reports insecure resources saves hours. Run it against the HTTPS version of the site only.

How to fix it

The right fix depends on where the insecure URL comes from. There are four standard approaches, and you can often combine them.

Change the URL to HTTPS

If the resource is available over HTTPS, simply change the scheme. This is the cleanest fix and works for most images, scripts and fonts on reputable services. Before you change it, open the HTTPS version of the address in a browser tab to confirm it really loads.

Use a relative or scheme-independent path

For resources on your own site, a path such as /images/logo.png works under both HTTP and HTTPS and avoids the issue entirely. Avoid the old trick of writing //example.com/file.js as a long-term habit, since today every site should be HTTPS anyway; a plain https:// URL says what you mean.

Fix the source in your CMS

In WordPress and similar systems the site address is stored in settings. If the "site URL" or "home URL" still starts with http://, every generated link will use it. Change both to https://. Then update stored content. A search-and-replace tool that understands serialised data is safer than a raw SQL replace, because changing the length of a serialised string can corrupt it. Always take a backup of the database first.

Host the asset yourself or replace it

If a third-party resource has no HTTPS version, you have three choices: download it (if its licence allows) and serve it from your own HTTPS site, find an alternative provider, or remove the element. An old widget that only speaks HTTP is also a sign that it may be unmaintained, which is a reason to replace it rather than patch around it.

The Content-Security-Policy upgrade directive

Some sites add a Content-Security-Policy: upgrade-insecure-requests header. It tells the browser to rewrite http:// sub-requests to https:// before sending them. It is a reasonable safety net and a good way to buy time on a big site, but it is not a substitute for cleaning up the source. If the HTTPS version of a resource does not exist, the request will simply fail. Treat the header as a bandage and the URL fix as the cure.

A worked example

Imagine a small shop at https://shop.example. After installing a certificate, the owner finds that product photos load but the checkout page loses its styling and the chat button is missing.

The console shows two messages. One names http://shop.example/wp-content/themes/shop/checkout.css. The other names http://chat-widget.example/embed.js.

The first is a stylesheet on the owner's own domain. The cause is a theme setting that stored the full http:// address. The owner changes the site URL to HTTPS in the settings, runs a safe search-and-replace for http://shop.example in the database, and clears the page cache. The stylesheet now loads over HTTPS.

The second is a script from a third party. The owner opens the vendor's documentation, finds that the current embed code uses an HTTPS address, and pastes the new snippet. After reloading with the console open, no messages remain. The padlock returns. The owner finally checks the checkout form's action attribute and a few old blog posts that embed images, fixes two more http:// links, and runs a crawler to confirm nothing else is flagged.

Prevention: keeping the problem away

  • Use HTTPS in every new URL you write, in content, templates and code.
  • When migrating, plan a full search of the database and theme files, not just the home page.
  • Keep a list of third-party embeds and review it when you update a theme or plugin.
  • Test new pages with the console open before publishing.
  • Configure the server to redirect HTTP to HTTPS so visitors and search engines land on the right version. This does not repair mixed content, but together with clean URLs it gives you a consistent setup.
  • Monitor certificate health too. Mixed content and certificate errors are different problems, and it is worth knowing which one you face. If your browser shows a name warning instead, see how to fix an SSL certificate name mismatch, and for untrusted-issuer errors see how to fix NET::ERR_CERT_AUTHORITY_INVALID.

Limits and what to watch for

  • Browsers differ. One browser may block an image while another upgrades it. Test in at least two browsers and on a phone.
  • Caches hide fixes. After changing URLs, clear the page cache, any CDN cache and your browser cache. Many "it is still broken" reports are simply stale copies.
  • Dynamic content. Resources created by JavaScript at run time may not appear until a user clicks something. Test menus, pop-ups, tabs and forms.
  • Email and feeds. Old newsletters or RSS feeds that point to HTTP images are outside your page, so a site-side fix will not reach them.
  • A valid certificate is necessary, not sufficient. The certificate proves your server identity and enables encryption, as explained in Cloudflare's overview of HTTPS. It does not clean the URLs inside your pages.
  • Do not weaken protection to hide the warning. Disabling security features, or telling users to click through warnings, is not a fix.

A short pre-publication checklist

To make this routine, here is a short list that a small web team can run whenever it changes a theme or adds a plugin. First, open five important pages in a private browser window so that old caches do not mix with the result. Second, open the console and look for mixed content messages. Third, submit a form once until it succeeds, because a form that posts data to an http:// address is far more serious than one broken image. Fourth, confirm that maps, videos and social buttons display. Finally, open the site once on a phone using a different network.

Do not forget the places visitors never see, such as canonical links, sitemaps and social sharing metadata. If they still point to http://, visitors may feel nothing, but search engines and outside platforms keep seeing the old address, and the move to HTTPS stays incomplete. Updating them in the same pass is a good habit, and keeping a note of where each past problem came from will tell you whether to fix a plugin or retrain a content team.

Summary

Mixed content appears when a page delivered over HTTPS requests some of its parts over plain HTTP. Active content such as scripts and stylesheets is blocked because it is the most dangerous, and passive content such as images may be upgraded or flagged. Find the problem with the browser console, a search of your templates and database, and a crawler. Fix it by changing URLs to HTTPS, using relative paths for your own files, correcting the site address in your CMS, and replacing third-party assets that cannot support HTTPS. A security header that upgrades requests helps as a safety net but does not replace the real fix, and an HTTP to HTTPS redirect does not remove mixed content by itself.

When you are ready to secure a site end to end, the SSL certificates page shows what is available and how to get started.

Frequently asked questions

What is mixed content?

Mixed content is when a page delivered over HTTPS pulls in some of its parts, such as images, scripts, stylesheets or frames, over plain HTTP. The page itself is protected, but those parts are not, so the browser may warn about them or block them.

Why does the padlock disappear even though I installed a certificate?

A valid certificate protects the connection to your server, but the browser judges the whole page. If a single resource is requested over HTTP, the browser can no longer treat the page as fully protected and may change or remove the padlock indicator.

Is active or passive mixed content worse?

Active content such as scripts, stylesheets and iframes is worse, because an attacker who alters it can change how the whole page behaves. Browsers usually block it. Passive content such as images is less dangerous and is often loaded with a warning, though modern browsers increasingly upgrade or block it too.

Does a redirect from HTTP to HTTPS fix mixed content?

No. A redirect only changes how visitors reach the page. Mixed content comes from the URLs written inside the page, so you have to change those URLs in the database, templates or code.

How do I find every insecure URL on my site?

Open the browser developer console and look for mixed content messages, search your database and theme files for http:// strings, and run a crawler or the Network panel on your key pages. Fix them to HTTPS or to relative paths and test again.

About the author

Bob Kanokphon Thongdee, founder of XPASS VPN

Bob Kanokphon Thongdee

  • Founder of XPASS VPN
  • Co-founder of eSIMonline.asia
  • More than 7 years in online marketing
  • Founder of Cojourney Visa and Cojourney Travel

Need an SSL certificate?

Pick the certificate type that fits your site and see the price before you check out.

SSL from $14.99

See SSL certificates

Keep reading

SSL Guides

How to Fix an SSL Certificate Name Mismatch

A certificate name mismatch means the hostname in the address bar is not on the certificate. Here is how to find the cause and put the right names on the right server.

10 min read

SSL Guides

How to Force an HTTP to HTTPS Redirect Correctly

Installing a certificate is only half the job. Learn how to send every visitor to the HTTPS version with a clean, loop-free permanent redirect.

10 min read

SSL Guides

How to Fix NET::ERR_CERT_AUTHORITY_INVALID

The browser does not trust the issuer of the certificate. Causes include self-signed certificates, a missing intermediate, a rewritten connection or an outdated device.

10 min read