Fixing "Not Secure" and Mixed Content Warnings

Print
  • 0

The confusing situation

You have an SSL certificate, your site loads over https, and yet the browser still shows "Not Secure," or the padlock has a little warning on it, or it is missing entirely on some pages. You did everything right and it still complains. This is one of the most baffling website problems, because the certificate is genuinely fine, the issue is something else wearing the same costume.

That something else is almost always mixed content, and this article explains what it is and how to fix it.

Certificate problem, or mixed content? Tell them apart first

Two different things produce a "Not Secure" message, and the fix for each is completely different, so identify which you have before doing anything:

  • A certificate problem means the secure connection itself is failing, the browser shows a full-page warning and will not load the site normally until you click past it. This is about the certificate, and our article on SSL certificate warnings covers it.
  • Mixed content means the connection is fine and the page loads, but the padlock is missing or marked, because the secure page is loading some of its pieces, an image, a script, a stylesheet, over the old insecure http instead of https. The page is mostly secure, but not entirely, so the browser will not award it a clean padlock.

If the site loads but the padlock is unhappy, you have mixed content. If the site will not load without a warning, it is a certificate issue. The rest of this article is about mixed content.

Why mixed content happens

When a site that used to run on http gets switched to https, the pages themselves move over, but individual items inside them often still point at the old http addresses. An image linked as http://yourdomain.tld/logo.png, a script loaded over http, a stylesheet with an http address, each of those insecure pieces on an otherwise secure page is enough to break the padlock. The browser's logic is strict: a secure page is only as secure as its least secure part.

This is why mixed content shows up right after moving a site to https, especially an older site, or one built before the certificate was in place.

Fixing it on WordPress

WordPress is where this happens most, and happily it is where it is easiest to fix:

  • Check your site address settings first. Under WordPress settings, your WordPress Address and Site Address should both begin with https, not http. If they still say http, updating them resolves a great deal of mixed content on its own.
  • Use a plugin to catch the rest. A plugin such as "Really Simple SSL" scans for insecure references and rewrites them to https automatically, which clears the great majority of mixed-content cases with very little effort. It is the same plugin that helps force https in the first place, as our article on forcing https describes.

Fixing it on other sites

On a site built by hand or on another platform, mixed content is fixed by finding the insecure references and correcting them. The browser itself will tell you where they are: most browsers, when you open their developer tools and look at the console, list each mixed-content item by name, which is the item to track down in your site's code and change from http to https, or to a relative address. This is genuinely technical, and it is the point where many people would rather hand it over.

When to let us help

If updating your WordPress settings and running a plugin has not cleared it, or your site is not WordPress and hunting through code is not where you want to spend your afternoon, open a support ticket. Tell us the site is showing "Not Secure" or mixed-content warnings, and ideally which page. This is a routine fix for us, we can see exactly which items are loading insecurely and correct them, and it is far quicker than chasing them one by one yourself.

Good to know

The key insight that saves the most frustration is the one at the top: a "Not Secure" warning after you have installed SSL is almost never the certificate. The certificate is doing its job, the page is simply loading a stray insecure piece or two, and once those are pointed at https the padlock goes clean. So before you doubt your certificate, suspect mixed content, it is the common cause by a wide margin, and the fix is usually a settings change and a plugin rather than anything to do with the certificate at all. Pair this with forcing https, covered in its own article, and your site is properly, cleanly secure from every angle.


Was this answer helpful?

« Back

Powered by WHMCompleteSolution