How to Fix Mixed Content Errors After Switching to HTTPS — SSL & Security SSL & Security

How to Fix Mixed Content Errors After Switching to HTTPS

By Genhost Team 2 min read

You installed SSL and forced HTTPS, but some pages still don’t show the padlock. The usual culprit is mixed content: a secure page that loads an image, script or stylesheet over insecure http://. Browsers flag — and sometimes block — these. Here’s how to clear it.

What mixed content is

When a page served over https:// pulls in a resource over http://, the connection is no longer fully secure. Browsers respond by:

  • Removing the padlock or showing “Not Secure”.
  • Blocking insecure scripts and stylesheets outright, which can break layout or features.

Every resource on the page must load over HTTPS for the padlock to show.

Step 1: Find the insecure resources

  1. Open the affected page in Chrome.
  2. Press F12 to open DevTools.
  3. Open the Console tab and reload.
  4. Look for “Mixed Content” warnings — each one names the exact http:// resource.

Common offenders: images, embedded videos, fonts, a slider or gallery script, or a hard-coded stylesheet.

For each flagged resource, change its URL from http:// to https://, or to a protocol-relative / relative link:

  • http://yourdomain.com/logo.png → https://yourdomain.com/logo.png
  • Better still, use a relative path: /logo.png

If a resource comes from another site that doesn’t support HTTPS, host a copy on your own site and link to that instead.

Step 3: WordPress — the fast fix

Most WordPress mixed content comes from old http://yourdomain links saved in the database (in posts, widgets and settings). Fix them in one pass:

  • Use a trusted search-and-replace plugin (or WP-CLI) to replace http://yourdomain.com with https://yourdomain.com across the database.
  • Back up your database first.
  • Then clear your cache (including LiteSpeed Cache) and recheck.

A simple SSL/HTTPS helper plugin can also rewrite insecure links on the fly, which is handy while you clean things up.

Step 4: Re-test every template

Check a page of each type — home, a post, a product, a contact page — because the insecure resource may only appear in one template. When the Console is clear and every page shows the padlock, you’re done.

Clean HTTPS, better trust and SEO

A fully secure site keeps visitors’ trust and avoids the ranking drag of security warnings. Our Web Hosting and WordPress Hosting plans include free SSL and LiteSpeed Cache, and support can help you track down a stubborn insecure resource. Next, make sure the redirect itself is solid with our force HTTPS guide.

Frequently asked questions

What is mixed content?

Mixed content is when a page loads over https:// but pulls in some resources - images, scripts, stylesheets or fonts - over insecure http://. Browsers flag the whole page as not fully secure, and may block the insecure scripts entirely.

How do I find what is causing mixed content?

Open the page in Chrome, press F12 for DevTools, and look at the Console tab. It lists every resource loaded over http:// so you know exactly what to fix.

Will fixing mixed content break my site?

No, done correctly it fixes your site. You are simply changing resource links from http:// to https:// (or to relative links). Back up first, especially before a database search-and-replace on WordPress.