rawatweb

Padlock Gone: Fixing Mixed Content in WordPress

Wordpress mixed content: site is on HTTPS but the padlock is missing or layouts break? Understand mixed content, how to find its source, and a safe order of repair.

Editorial illustration of a web page mixing secure and insecure links around padlock icons.

Wordpress mixed content means the page loads part of itself over plain HTTP.

The SSL certificate is installed, the site opens over https://, yet the padlock will not appear—or appears with a warning. Pages render without images, fonts change, and some forms fail to submit. Developer tools report mixed content.

This is not a certificate failure. A certificate only secures the path between the browser and the server. If a secure page still loads an image, script, or iframe over http://, the browser treats the page as mixed and downgrades its status.

Short answer: mixed content happens when assets on an HTTPS page load over HTTP. Fix it at the source: make sure the site address uses HTTPS, replace database URLs with a serialization-aware tool, then handle assets from external services. Server redirects help, but they do not clear every warning.

Two kinds of mixed content

Browsers separate two levels, and the difference explains the symptoms:

Passive mixed content covers images, video, audio, and some iframes. Browsers usually still display them, but mark the page as not fully secure. The padlock disappears or changes, and some browsers warn visitors when they open a form.

Active mixed content covers scripts, stylesheets, and AJAX requests. This is more serious and often gets blocked outright. JavaScript stops running, sliders die, buttons stop responding, and checkout becomes unusable.

That second type explains many “the site broke after we installed SSL” reports on sites that look mostly fine. Blocked scripts only break specific behaviour.

Start with the site address

Before combing the database, confirm the two base values. Under Settings → General, both the WordPress address and the site address must use https://. If either still says http://, WordPress will generate mixed URLs in numerous places at once.

Next, check whether a forced redirect exists. Many hosts offer a “force HTTPS” toggle, but not all do. If it is missing, add the rule at the server level—not inside an SEO plugin, since a server rule is faster and more reliable.

Remember: redirecting page requests does not rewrite asset URLs in the HTML. The browser still sees src="http://..." in the markup and flags it. Redirects alone are not enough.

Finding the source quickly

The fastest method is to open the affected page and:

The browser console names the exact asset, which is why wordpress mixed content problems are usually faster to fix than to find.

  1. Open developer tools, Console tab. Mixed content warnings usually name the exact URL.
  2. Open the Network tab, reload, and look for http:// requests.
  3. Use your browser’s view-source search for http:// and inspect the context.

Write down every URL that appears. In practice the sources fall into five groups:

  • URLs inside post and page content.
  • Images or assets stored in theme settings.
  • Widgets, menus, or the Customizer.
  • Scripts from third-party services.
  • Code inside theme or plugin files.

Grouping by source is more useful than fixing one URL at a time, because one pattern usually repeats dozens of times.

Wordpress mixed content: Replacing database URLs safely

Once the site address is right, most remaining problems live in wp_posts, wp_postmeta, and wp_options. Replacing them in a SQL dump with a text editor risks corrupting serialized data, whose format records string lengths.

Safe tools:

  • WP-CLI: wp search-replace 'http://domain.com' 'https://domain.com' --all-tables --dry-run, then run it without --dry-run.
  • A search-and-replace plugin that understands serialization.
  • A migration tool that handles both.

Always dry-run first, review how many rows would change, then execute after a backup. If both the domain and the protocol change, replace the old domain first. A full walkthrough is in WordPress broken after moving hosts.

Assets from external services

Not every mixed-content source lives on your site. Fonts, maps, video, and analytics scripts are often loaded from another domain that may only support HTTP or expose a different URL for HTTPS.

Common finds:

  • Google Fonts copied from old documentation with http://.
  • Embedded maps using an HTTP URL.
  • Ad or tracking scripts from a legacy vendor.
  • Images hosted on a third-party service.

The fix depends on the provider:

  1. Switch to the HTTPS URL if one exists—usually a protocol change.
  2. Change providers if there is no HTTPS support at all.
  3. Remove assets you no longer use; this is the safest option.

For fonts, self-hosting removes the problem and cuts a third-party request at the same time.

Code in themes and plugins

Some URLs are written directly into files: wp_enqueue_script with an http:// address, or attributes in a template. Editing files means the change disappears the next time the theme or plugin updates.

More durable approaches:

  • Search the active theme directory for http:// and fix only genuine site assets.
  • Use a filter to swap URLs at render time when the change is temporary.
  • Record every edit so it can be reapplied after an update.
  • Consider a child theme for permanent changes.

If the source is an unmaintained third-party plugin, replacing it may be cheaper than patching it forever.

Are redirects enough?

A common recommendation is to force every HTTP request to HTTPS via .htaccess or Nginx configuration. That is genuinely needed for visitors typing the old address, and it helps assets requested over HTTP.

But redirects have limits:

  • Passive content is usually reloaded over HTTPS, hiding the symptom.
  • Active content may be blocked before the redirect happens.
  • Performance drops because of the extra request per asset.
  • The markup problem remains and reappears the next time caches are cleared.

In short: a redirect is a safety net, not a repair. Fix the URLs, then keep the redirect as backup.

Cache and CDN after the fix

After fixing URLs you may still see old pages with mixed content, because caches hold old HTML. Clear them in order:

After a wordpress mixed content fix, purge the cache and the CDN, then load the page as a logged-out visitor.

  1. Plugin cache.
  2. Object cache.
  3. CDN cache.
  4. Browser cache during testing.

CDNs cause particular confusion because they keep serving the old version even after the origin is correct. If you use a CDN with “Full” or “Flexible” SSL modes, make sure the chosen mode does not create a redirect loop or hand HTTP back to visitors.

Wordpress mixed content: HSTS — only once it is truly clean

When the site is genuinely free of mixed content, you can consider HSTS, which tells browsers to use HTTPS only for your domain. It improves security but closes the door behind you: if an asset still loads over HTTP, visitors see a broken site with no way through.

Roll it out gradually:

  1. Confirm every page is clean, including rarely visited ones.
  2. Test with a short max-age first.
  3. Increase the duration after a few clean weeks.
  4. Remember that subdomains are affected if you use includeSubDomains.

Do not deploy HSTS as a “fix” for mixed content. It locks in whatever state you have.

A checklist to work from

  • WordPress address and site address both use https://.
  • Forced HTTP → HTTPS redirect is active at the server level.
  • Database URLs were replaced with a serialization-aware tool.
  • No http:// remains in theme settings, widgets, or menus.
  • Third-party assets use HTTPS or have been replaced.
  • Theme and plugin files contain no HTTP URLs for their own assets.
  • Plugin cache, object cache, and CDN cache are cleared.
  • Test pages cover the homepage, a post, the contact page, and any page with a form.
  • The certificate is unexpired and covers every hostname in use.

Short as it is, this list covers most of what turns up in practice.

Wordpress mixed content: what matters first

Mixed content means an HTTPS page still loads some assets over HTTP, so the browser marks the connection as not fully secure. The certificate is rarely the cause; usually it is http:// URLs stored in the database, in the theme, or in third-party scripts. Plugin is usually the first place that gives a clue.

Frequently asked questions

Does installing SSL fix links automatically? No. A certificate secures the connection; URLs stored in content stay exactly as they were.

Why do images still load when the padlock is gone? That is passive content: the browser displays it while marking the page as not fully secure. The padlock returns only when every asset uses HTTPS.

Is a 301 redirect enough? For some passive assets it looks that way. For scripts and active requests, not always. Fix the URL.

Does mixed content affect SEO? Not massively on its own, but visitor trust and conversions can drop. Search engines also favour secure pages.

If you have replaced URLs and warnings persist, the source may sit somewhere rarely checked: an old widget, an ad script, or a CDN cache. A free audit can map every source before repair, and monthly website care keeps this kind of check on a schedule. If the site became unreachable after the SSL change, website emergency support is the fastest route.

Read next: Slow WordPress Admin While the Front End Is Fast, WordPress Broken After Moving Hosts: 7 Checks to Run, One Page Returns 500 While the Rest of the Site Works.

#ssl #https #mixed content #security
Let's talk about your website

Does any of this look like your website?

Tell us on WhatsApp. We look first, explain what needs fixing, then you decide. For a fuller picture, request the free audit.

Chat with us