Home/Blog/How to Fix Mixed Content Error in WordPress After SSL (2026)

How to Fix Mixed Content Error in WordPress After SSL (2026)

mixed content error in WordPress after SSL โ€” broken padlock warning

What Is the Mixed Content Error in WordPress?

You just installed an SSL certificate, the padlock should be green โ€” but your site still shows “Not secure” or “Your connection is not fully secure” in the address bar. The cause is almost always the mixed content error: your page loads over HTTPS, yet one or more assets (an image, a script, a stylesheet, a font, or an iframe) are still being loaded over plain, unencrypted HTTP. Browsers like Chrome flag this because those HTTP resources can be read or tampered with by attackers, which defeats the purpose of the SSL certificate. Modern browsers go further: they silently block “active” mixed content such as scripts and stylesheets, so your site may look broken โ€” sliders missing, fonts wrong, buttons unstyled โ€” even though the site technically loads. This mixed content error WordPress fix guide walks you through finding every insecure asset and fixing it for good, in about 20 minutes.

Why the Mixed Content Error Happens After SSL

The most common causes are:

  • Old http:// links in the database: images, internal links and embeds saved while the site ran on HTTP keep their old absolute URLs after SSL is enabled.
  • WordPress Address / Site Address still on http: under Settings > General the two URLs were never updated to https://.
  • Hardcoded http:// URLs in the theme or widgets: older themes and sidebar widgets sometimes link scripts, fonts or images with explicit http://.
  • Third-party embeds: YouTube iframes, ad networks, CDNs, font libraries or analytics scripts referenced over http://.
  • No HTTPS redirect: visitors arriving via old http:// bookmarks still see insecure pages.
  • Elementor or page-builder caches: builders store rendered HTML with old URLs until their caches and CSS files are regenerated.

How to Find Which Assets Cause the Mixed Content Error

Before fixing anything, pinpoint the culprits:

  1. Open the affected page in Chrome, press F12 to open Developer Tools, and click the Console tab.
  2. Reload the page. Look for lines starting with “Mixed Content:” โ€” each one names the exact http:// asset being blocked or warned about.
  3. For a site-wide scan, use a free scanner like Why No Padlock or JitBit SSL Checker, which lists every insecure URL on the page.
  4. Fix the listed assets using the methods below, then re-check until the console is clean.

7 Ways to Fix the Mixed Content Error in WordPress

Method 1: Update the WordPress and Site Addresses

The very first thing to check is Settings > General in your dashboard. Both WordPress Address (URL) and Site Address (URL) should begin with https://. If either still uses http://, change it and save. WordPress will use these addresses for new uploads, links and generated URLs going forward. Note: if you cannot log in after a bad change here, the fix is to add the correct URLs to wp-config.php with define('WP_HOME', 'https://yourdomain.com') and define('WP_SITEURL', 'https://yourdomain.com').

Method 2: Replace HTTP with HTTPS in the Database

This fixes the bulk of cases. Because WordPress stores many settings in serialized format, never run a raw SQL REPLACE in phpMyAdmin โ€” it breaks serialized string lengths. Instead:

  1. Back up your database (your host’s backup tool or a plugin like UpdraftPlus).
  2. Install and activate Better Search Replace, then go to Tools > Better Search Replace.
  3. In “Search for” enter http://yourdomain.com; in “Replace with” enter https://yourdomain.com.
  4. Select all tables, run a dry run first to preview changes, then uncheck the dry-run box and run it for real.
  5. Clear all caches (step 6 below) and re-check the browser console.

If you have SSH access, the WP-CLI equivalent โ€” wp search-replace 'http://yourdomain.com' 'https://yourdomain.com' โ€” is faster and also serialization-safe.

Method 3: Let a Plugin Handle the Rewriting

If you prefer a one-click approach, plugins like Really Simple SSL or SSL Insecure Content Fixer rewrite http:// URLs to https:// on the fly as pages render. Activate one, go to its settings, and raise the fix level until the warning disappears. These are excellent for quick wins, but they only mask the problem at render time โ€” Method 2 still fixes the source data, which is better long-term.

developer fixing mixed content warnings in browser developer console

Method 4: Force a Site-Wide HTTPS Redirect

A certificate alone does not stop visitors arriving at the http:// version of your site. Force the redirect at server level, which is faster and more reliable than a plugin. Add this to the top of your .htaccess file (back it up first):

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

If you use Cloudflare, double-check its SSL mode: set it to Full (strict), not Flexible. Flexible mode with a server-side redirect is a classic cause of an ERR_TOO_MANY_REDIRECTS loop โ€” see our redirect loop fix guide if that happens.

Method 5: Fix Elementor and Theme-Level URLs

Page builders store their own copies of URLs. In Elementor > Tools > Replace URL, enter the old http:// domain and the new https:// domain and save. Then click Regenerate CSS & Data under Elementor > Tools. If the console still points at an asset inside your theme (e.g. a font in header.php or a script enqueued in functions.php), edit the theme file to use https:// or a root-relative path โ€” or better, report it to the theme author as a bug.

Method 6: Clear Every Layer of Cache

Stale cache is the number-one reason a fix “does not work”. After changing URLs, clear: your caching plugin’s cache (e.g. LiteSpeed Cache), the server or CDN cache (Cloudflare > Caching > Purge Everything), your browser cache or a hard refresh (Ctrl+Shift+R), and any object cache. Then re-check the padlock on a few different pages.

Method 7: Re-Check Third-Party Embeds and the Console

If the warning persists after all this, revisit the console output. Remaining items are usually external: an ad script, a social-media embed or a font served over http://. Change the embed URL to https:// (all major providers support it) or remove the insecure embed. Re-run the scan until every resource loads securely.

Post-Fix Verification Checklist

  • The padlock shows secure on the homepage, posts, pages and checkout/login pages.
  • Browser console (F12) shows zero “Mixed Content” warnings.
  • An external SSL scan (e.g. SSL Labs) reports no issues and an A rating ideally.
  • Google Search Console shows https:// versions of your URLs being indexed.
  • Visitors typing the old http:// URL are 301-redirected to https://.

Frequently Asked Questions

Why does my site show “Not secure” even though SSL is installed?

The certificate encrypts the connection, but mixed content means some page assets still load over http://. Browsers downgrade the padlock until every asset on the page is secure.

Can I just use protocol-relative URLs (starting with //)?

That is an outdated workaround. Use explicit https:// URLs, or root-relative paths (like /wp-content/…) for files on your own domain.

Is a plain SQL REPLACE in phpMyAdmin safe for this fix?

No. WordPress serializes many options, and plain REPLACE breaks their stored lengths, which can corrupt settings. Use WP-CLI or a serialization-aware tool like Better Search Replace.

How long until Google shows my site as secure?

The padlock is instant once the assets are fixed. Search Console may take a few days to re-crawl and reflect the change across indexed pages.

Conclusion

The mixed content error after SSL looks alarming, but it is really just a cleanup job: update the two URLs in Settings, search-replace the database the safe way, force a server-level HTTPS redirect, clear every cache, and chase the last stragglers through the browser console. Do that, and the padlock stays green everywhere. For related fixes, see our guides on the “Your Connection Is Not Private” error and ERR_CONNECTION_TIMED_OUT โ€” and browse our free WordPress tools for more site fixes.