wordpress 2026-12-02 ⏱ 4 min read

How to Fix Mixed Content in WordPress

How to Fix Mixed Content in WordPress

To fix mixed content in WordPress, find each http URL on an https page, back up, replace the stored URLs safely, then regenerate the builder and page caches. The certificate is fine; the page is asking for something over http.

Step 1: Find the insecure URLs

Open the affected page, press F12, and look at the Console. Each warning names the exact URL. The Network tab can be filtered by "http:" to show everything still loaded insecurely. Write down the pattern, such as a theme folder, an upload path or an external script.

Where the URL hidesHow to spot itHow to fix
Post and page contentImages in the body use httpDatabase search and replace
Theme or customizer optionsLogo or header image failsRe-save the option or replace in database
Page builder CSS cacheBackground images failRegenerate builder CSS
Hard-coded template filesAppears on every pageEdit the template
External scriptsThird-party host uses httpUse its https URL

Step 2: Back up

Export the database before any bulk change. A mistaken replace on serialised data is the one way to turn a small warning into a large problem.

Fix mixed content in WordPress: stored URLs

Use WP-CLI if you have shell access. Run the dry run first and read the counts:

wp search-replace "http://example.com" "https://example.com" \
  --dry-run --skip-columns=guid
wp search-replace "http://example.com" "https://example.com" \
  --skip-columns=guid

Without shell access, a search and replace plugin that understands serialised data does the same job. Do not use a plain find and replace in a SQL dump. It breaks the length counts in serialised values.

Fix mixed content in WordPress: caches

Elementor, Divi and similar builders save generated CSS files with absolute URLs. After the database replace, regenerate those files from the builder's tools or settings page. Then clear the page cache, object cache and any CDN cache. Many "it still shows" reports come from stale caches. Our longer guide for Elementor, Divi and WooCommerce covers those tools one by one.

Step 5: Fix templates and external links

Search your theme and child theme for hard-coded addresses:

grep -rn "http://" wp-content/themes/your-theme

Replace them with protocol-relative paths or with WordPress functions such as get_template_directory_uri(), which follow the site setting. For third-party scripts, change the URL to https. If the vendor does not offer https, remove the script.

Step 6: Check again

  1. Reload the page with the Console open and caches cleared.
  2. Test several page types: home, post, archive, search, checkout.
  3. Run the SSL checker to confirm the certificate is not the problem.
  4. Re-test after any plugin update, since new scripts can reintroduce the issue.

Do not rely on output filters

Plugins that rewrite http to https at output time are a useful stopgap. They add work to each request and hide the underlying data. Use one while you clean up, then remove it. If your site sits behind a proxy, also check that WordPress knows the request was secure. See the reverse proxy SSL guide.

When the page is clean, you can think about HSTS. Read the security headers guide first, since HSTS makes mistakes harder to undo.

A worked example

Say the Console lists a logo at http://example.com/wp-content/uploads/logo.png. First check where it comes from. If it appears only on the homepage, it is probably set in a widget or the customizer. If it appears on every page, look at the theme header or a global builder template. Fix it where it is stored, then run the database replace for the rest. Fixing the source once is better than patching the output on each request.

Keeping it fixed

  • Paste media with its https address, or upload it to the media library.
  • After importing content from an old site, run the replace again.
  • Test one page of each type after theme and plugin updates.
  • Watch Search Console for security issues flagged on https pages.

Related reading: the Elementor, Divi and WooCommerce fixes, the mixed content checker and the cPanel AutoSSL route.

Frequently Asked Questions

Does changing the site URL in settings fix mixed content?

Only for URLs WordPress generates. Serialised data in widgets, builder templates and theme options keeps the old http string, and a plain search and replace can corrupt it, which is why a serialisation aware tool is safer.

Why does the padlock come back after I fix it?

Something regenerated the old URL: a cached page, a builder stylesheet, or a plugin writing its own asset URLs. Clear the page cache and the builder cache, then check the page again.

Can a security plugin block the http asset instead?

It can, but the asset then fails to load. The upgrade-insecure-requests header is a stopgap for images while you find the source, not a fix for scripts and stylesheets.

🛡️ Scan Your Site for Mixed Content & Security Headers
Scan Security Headers →

✅ Post-Installation Verification & SEO Checklist

After applying the steps above, run through this 5-point checklist to prevent browser warnings and protect your Google SEO rankings:

  • Verify full CA chain trust and TLS 1.3 support using our Live SSL Checker.
  • Scan for Mixed Content HTTP links and check HSTS/CSP headers on Security Headers Checker.
  • Enforce a permanent 301 HTTP-to-HTTPS redirect with our HTTPS Redirect Generator.
  • Confirm both root and www versions resolve cleanly to one canonical HTTPS URL.
  • Verify your HTTPS property and sitemap.xml inside Google Search Console and Bing Webmaster Tools.
Technically Reviewed by TryFreeSSL Security Team
Last updated: 2026-12-05
About Us →

Free SSL Certificates, Live SSL Checker & CSR Generator

Issue trusted Let's Encrypt SSL certificates in 60 seconds with zero server setup.

Related Articles

🤖 TryFreeSSL AI Assistant