How to Fix Mixed Content Warnings on an HTTPS Website
Mixed content happens when a page served over HTTPS still loads images, scripts, stylesheets, fonts or iframes over plain http://. By the end of this guide you will have found every insecure asset URL, switched each one to HTTPS, added a safety-net header, and confirmed that no page on your site still requests anything over http://.

Why it matters
Browsers block insecure scripts, stylesheets and iframes outright, which breaks layouts, forms, analytics and checkout widgets. Chrome and other browsers try to auto-upgrade insecure images, audio and video to https://. If that upgrade fails, the file simply doesn't load, and the padlock can be downgraded to a 'Not fully secure' warning.
Broken rendering and security warnings hurt conversions and user trust. They also leave crawlers and AI systems with an incomplete page to read. Script injection over an unencrypted connection is a real attack vector on shared Wi-Fi.
What you need
Step-by-step fix
List every insecure request on affected pages
Open an affected page, press F12, and check the Console tab for messages starting with 'Mixed Content:'. Then open the Network tab, reload the page, and type http:// in the filter box to see each insecure request. Also run View Source (Ctrl+U) and search for src="http://, href="http:// and url(http:// to catch references that the browser auto-upgraded or blocked silently.
Note the type of each one: image, script, stylesheet, font, iframe or form action.
curl -s https://example.com/pricing | grep -oE '(src|href|action)="http://[^"]+"|url\(http://[^)]+\)'
Confirm each asset is available over HTTPS
Before you change any URL, check that the https:// version actually works. If it returns 200, you can switch it directly. If it fails, the host doesn't support HTTPS.
In that case, download the file and host it on your own domain, or swap in the provider's current HTTPS embed code.
curl -sI https://cdn.example.com/widget.js | head -n 1
Fix hard-coded URLs in templates and theme files
Edit your theme, layout and include files and change http:// to https://. png are even better, because they keep working if the domain changes. Don't use protocol-relative //` URLs.
They are an outdated pattern and give you nothing over explicit https:// URLs.
<!-- Before --> <img src="http://example.com/img/logo.png" alt="Example Co"> <script src="http://cdn.example.com/widget.js"></script> <!-- After --> <img src="/img/logo.png" alt="Example Co"> <script src="https://cdn.example.com/widget.js"></script>
Update CSS backgrounds and web fonts
Stylesheets often hide insecure references inside url() and @import. Check these places:
- background images
@font-facesrc lines- imported Google Fonts or icon-font links
Fonts loaded over http:// are blocked, so text falls back to system fonts.
@font-face {
font-family: "ExampleSans";
src: url("https://example.com/fonts/examplesans.woff2") format("woff2");
}
.hero { background-image: url("/img/hero.jpg"); }Replace http:// URLs stored in the database
Content written before your HTTPS move still contains absolute http:// links inside posts, product descriptions, widgets and custom fields. Use a serialization-safe search-replace tool rather than raw SQL. Raw SQL can corrupt serialized data in plugins and page builders.
Always do a dry run and take a backup first.
wp db export backup-before-https.sql wp search-replace 'http://example.com' 'https://example.com' --all-tables --precise --dry-run wp search-replace 'http://example.com' 'https://example.com' --all-tables --precise
Add upgrade-insecure-requests as a safety net
The Content-Security-Policy: upgrade-insecure-requests header tells browsers to rewrite any remaining http:// subresource requests to https:// before sending them. It catches references you missed, such as URLs entered by editors in the future. It does not replace fixing the source: assets without HTTPS support will still fail, and some crawlers ignore the header.
# Nginx (server block) add_header Content-Security-Policy "upgrade-insecure-requests" always; # Apache (.htaccess) Header always set Content-Security-Policy "upgrade-insecure-requests"
Purge caches and re-check the flagged pages
Clear your page cache, CDN cache and any optimization plugin cache. Cached HTML will keep serving the old http:// URLs otherwise. Reload each flagged page in a private window with DevTools open, and confirm the Console shows no 'Mixed Content' messages.
Confirm the Network tab filtered by http:// is empty. Then re-run the audit so it re-crawls every page.
Platform-specific notes
WordPress
Go to Settings > General and set both 'WordPress Address (URL)' and 'Site Address (URL)' to https://. Then fix stored content with `wp search-replace` (WP-CLI) or the Better Search Replace plugin. Plugins like Really Simple SSL can rewrite output on the fly, but fixing the database is the cleaner long-term solution. Also check Appearance > Customize > Additional CSS and any widget HTML.
Shopify
Shopify serves storefronts over HTTPS automatically. Mixed content almost always comes from theme code or rich-text content. In Online Store > Themes > ... > Edit code, search theme.liquid, sections and snippets for http://. Use `{{ 'file.png' | asset_url }}` for theme assets. Also check product and page descriptions in their HTML view for pasted http:// images.
Wix / Squarespace
Both platforms force HTTPS on their own assets. The usual culprits are custom code embeds: in Wix, Settings > Custom Code and HTML iframe elements; in Squarespace, Settings > Advanced > Code Injection and Code Blocks. Edit any embed that references http:// and switch it to the provider's HTTPS embed code.
Webflow
Check Site settings > Custom code (head and footer), page-level custom code, and Embed elements for http:// URLs. Assets uploaded through the Webflow Assets panel are already served over HTTPS. Republish the site after editing.
Cloudflare
Enable SSL/TLS > Edge Certificates > 'Automatic HTTPS Rewrites' to rewrite http:// links to https:// where Cloudflare knows the target supports HTTPS. Also turn on 'Always Use HTTPS'. This only rewrites traffic at Cloudflare's edge, so still fix the source URLs. Purge the cache under Caching > Configuration afterwards.
Check that it worked
✅ How to verify
- Open each previously flagged page with DevTools open and confirm the Console has no 'Mixed Content' messages and the padlock shows a secure connection.
- Run `curl -s https://example.com/page | grep -c 'http://example.com'` and similar checks for third-party asset hosts. Expect 0 asset matches (plain hyperlinks to other sites are fine).
- Re-run the site audit and confirm the mixed content check reports 0 affected pages.
- Spot-check with a crawler such as Screaming Frog (Security tab > Mixed Content filter) for a whole-site view.
⚠️ Common mistakes
- Only fixing the page the audit showed first, when the http:// URL lives in a site-wide header, footer or CSS file that affects every page.
- Relying only on upgrade-insecure-requests or a plugin rewrite and leaving http:// URLs in the source. Assets without HTTPS support still break, and the problem returns if the plugin is disabled.
- Running raw SQL REPLACE on WordPress tables, which corrupts serialized plugin and page-builder data.
- Forgetting to purge page, CDN and optimization caches, so the old HTML keeps serving insecure URLs after the fix.
Is this still an issue on your site? Run a free audit — ZORO checks this and 294 other SEO, AI-visibility, accessibility and security signals, with fixes for your platform.
Check my site freeFAQ
What is mixed content on a website?
Mixed content is an HTTPS page that loads some resources over insecure HTTP, such as images, scripts, stylesheets, fonts, iframes or form actions. Browsers block the risky types (scripts, CSS, iframes). They try to auto-upgrade images and media to HTTPS and drop them if the upgrade fails.
Does mixed content affect SEO?
Indirectly, yes. HTTPS is a confirmed ranking signal, and blocked scripts or CSS can change how search engines render your page. Security warnings also hurt engagement and conversions. Fixing mixed content makes sure the fully secure version of each page is what users and crawlers see.
Why do I still get mixed content warnings after installing an SSL certificate?
An SSL certificate only encrypts the page itself. Any URL written as http:// in your templates, CSS or database content still tells the browser to fetch that resource insecurely. You need to update those URLs to https:// or relative paths.
Should I use protocol-relative URLs like //example.com/file.js?
No. Now that HTTPS is universal, protocol-relative URLs offer no benefit, and they can load over HTTP in some contexts. Use explicit https:// URLs for external assets and root-relative paths like /img/logo.png for files on your own domain.
How to Fix SSL Certificate Expiry and Trust Errors
How to Fix the HTTP to HTTPS Redirect (301) on Your Site
How to Fix a Missing HSTS Header (Strict-Transport-Security)
How to Enable HTTPS and Redirect Your Site from HTTP
How to Fix www vs non-www Duplicate Hostnames with 301s
How to Set Up Google Consent Mode v2 Defaults on Your Site