Security & Web

How to Fix "Not Secure" Warning & SSL Mixed Content

H
HTMLtoPHP TeamMay 18, 2026 โ€ข 7 min read

You just installed an SSL certificate on your web hosting account. You visit your website expecting to see a clean, green security padlock in the address bar. Instead, Google Chrome slaps your site with a warning icon and a bold label reading "Not Secure".

This is the infamous SSL Mixed Content Error. It happens when your initial HTML document is delivered securely over encrypted HTTPS, but the page still loads images, stylesheets, fonts, or scripts using plain, unencrypted http:// URLs. In this tutorial, we will show you how to identify every broken asset and eliminate mixed content errors permanently.

"Mixed content destroys visitor trust in an instant. Over 70% of shoppers will abandon their cart immediately if a checkout page displays a 'Not Secure' warning in their browser."


1. Passive vs. Active Mixed Content

Browsers categorize mixed content into two distinct danger levels:

โš ๏ธ Warning Icon

Passive Mixed Content (Display)

Includes unencrypted images (<img src="http://...">), audio, and video files. Browsers will still load the images, but the security padlock will disappear from the URL bar.

๐Ÿ›‘ Blocked Content

Active Mixed Content (Scripts)

Includes unencrypted JavaScript files, CSS stylesheets, iframes, and AJAX requests. Modern browsers will block these scripts completely, breaking your site layout or shopping cart.


2. How to Find Insecure HTTP Assets in Chrome DevTools

  1. Open your website in Google Chrome.
  2. Right-click anywhere on the page and select Inspect (or press F12).
  3. Click on the Console tab.
  4. Look for yellow or red warning lines reading: Mixed Content: The page at 'https://...' was loaded over HTTPS, but requested an insecure resource 'http://...'.
  5. Chrome will display the exact image or script file URL causing the security warning.

3. The 1-Line Fix: upgrade-insecure-requests

If your site has thousands of legacy hardcoded http:// image links, manually editing each file is exhausting. You can instruct the browser to automatically upgrade every http:// request to encrypted https:// by adding one Content Security Policy meta tag into your HTML <head>:

<!-- Place inside <head> -->
<metahttp-equiv="Content-Security-Policy"content="upgrade-insecure-requests">

4. Forcing 301 HTTPS Redirection in .htaccess

Ensure all visitors and Google crawlers are permanently redirected to the encrypted HTTPS version of your site by placing these rules at the top of your root .htaccess file:

# Force HTTPS Redirection in Apache
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^(localhost|127\.0\.0\.1)$ [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

5. Fixing Hardcoded Database URLs in WordPress

If you are using WordPress, changing your site address in Settings → General only updates the main URLโ€”it does NOT update old blog post image URLs in your MySQL database.

How to Fix in 2 Minutes:

Install a free search-and-replace plugin (like Better Search Replace). Search your database tables for http://yourdomain.com and replace with https://yourdomain.com.


Frequently Asked Questions

How do I verify if my SSL certificate is installed correctly?
Use our free SSL Certificate Checker. It tests your domain against modern browser trust stores, validates certificate chains, and checks expiration dates.
Does mixed content hurt my Google rankings?
Yes. Google considers HTTPS a direct Page Experience ranking signal. Sites triggering security warnings receive lower ranking priority and suffer from increased visitor bounce rates.

Conclusion

Eliminating mixed content errors restores the green security padlock to your address bar and guarantees that every visitor browses your site safely.

Audit your website's SSL status right now.

Verify your certificates, inspect HTTP headers, and test server security for free.

Run Free SSL Audit โ†’

More Guides (20)

View All โ†’
โœ‰๏ธ
Email & Productivity

How to Set Up Custom Domain Email in Outlook, Gmail & iPhone

8 min read
โ˜๏ธ
Networking & DNS

How to Set Up Cloudflare Free CDN & DNS: Speed, SSL & Protection

8 min read
๐Ÿ“ฌ
Security & Authentication

Why Are My Emails Going to Spam? How to Fix SPF, DKIM & DMARC

8 min read
๐Ÿ”“
Security & AuthenticationReading

How to Fix "Not Secure" Warning & SSL Mixed Content Errors

7 min read
๐Ÿš€
Networking & DNS

How to Connect a Custom Domain to GitHub Pages, Vercel & Netlify

8 min read
๐ŸŒ
Networking & DNS

The Ultimate Guide to DNS Records: A, AAAA, CNAME, MX, TXT & PTR

8 min read
๐Ÿ“ก
Networking & DNS

What Is an IP Address? Public vs. Private IPv4, IPv6 & Subnetting

7 min read
๐Ÿšฆ
Networking & DNS

HTTP Status Codes Explained: 200, 301, 404, 500 & 502 Bad Gateway

7 min read
๐Ÿ›ก๏ธ
Security & Authentication

JSON Web Tokens (JWT) Demystified: Header, Payload & Signatures

8 min read
โšก
Web Performance & SEO

Mastering Core Web Vitals in 2026: Optimize LCP, INP & CLS for SEO

8 min read
๐Ÿ”’
Security & Authentication

Is Your Website Actually Secure? 3 Network Checks You Must Run

6 min read
๐ŸŽจ
Developer & Data Tools

The CSS Color Nightmare: How to Manage HEX, RGB, and Gradients

6 min read
๐Ÿงน
Developer & Data Tools

Data Cleaning Guide: How to Clean JSON, CSV & Text Like a Pro

7 min read
๐Ÿ”—
Content & Social

Stop Sharing Ugly Links: The Complete Guide to Open Graph & Twitter Cards

4 min read
๐Ÿ“‰
Web Performance & SEO

Why You Must Minify HTML, CSS, and JS Before Every Deployment

4 min read
๐Ÿ–ผ๏ธ
Web Performance & SEO

Stop Using PNGs for Everything: The Developer Guide to Image Formats

5 min read
๐Ÿš€
Web Performance & SEO

5 Essential Steps to Optimize Your Website Before Launch

4 min read
๐ŸŽฏ
Web Performance & SEO

Why Your Website is Invisible on Google: The Ultimate Meta Tag Checklist

5 min read
๐Ÿ”—
Developer & Data Tools

Stop Breaking Your Links: The Developer Guide to URL Encoding and Base64

5 min read
๐Ÿ“
Content & Social

Stop Writing HTML by Hand: The Ultimate Guide to Markdown and Text Tools

5 min read
โšก

Explore 70+ Free Tools

Instant client-side developer, networking, SEO & formatting utilities.

Browse All Tools โ†’