Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared Managed Cloud India
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Best lists Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Troubleshooting · Troubleshooting

How to Fix Mixed Content Warnings After Moving to HTTPS in WordPress

Short answer

A mixed content warning means your page loads over HTTPS but still asks for at least one file over HTTP. Fix it by changing both WordPress address settings to https, replacing old http addresses in the database with a tool that handles serialized data, and then checking the browser console until no insecure request is left.

Key takeaways

  • Mixed content means an HTTPS page still loads at least one image, script, style sheet, or frame over HTTP.
  • Browsers block scripts, style sheets, and frames loaded over HTTP, while many images and videos are upgraded to HTTPS first.
  • Change both the WordPress Address and the Site Address to https before you replace URLs in the database.
  • Use WP-CLI search-replace or another tool that handles serialized data, and run a dry run after a full backup.
  • Cloudflare Automatic HTTPS Rewrites can hide a warning, but it does not fix the stored http address.
  • Check the fix in the browser console and on several page types, not only the home page.

What does a mixed content warning mean in WordPress?

A mixed content warning means your page loads over HTTPS, but at least one file on it still loads over HTTP.

web.dev defines mixed content as a page whose first HTML loads over HTTPS while other resources, such as images, videos, style sheets, and scripts, load over HTTP. That mix is why the padlock can vanish even when your certificate is valid.

The warning is not the same as a certificate error. If the certificate itself is wrong or expired, the browser warns before the page loads at all. For a certificate problem, see how to fix ERR_SSL_PROTOCOL_ERROR.

Why does mixed content appear after moving to HTTPS?

Mixed content appears because installing a certificate does not change the old http addresses already saved in your site.

Posts, widgets, theme settings, and plugin settings often hold full addresses such as http://example.com/wp-content/uploads/logo.png. Those values stay in the database after the move, so WordPress keeps asking for them over HTTP.

WordPress 5.7, released in March 2021, added a one-click HTTPS switch in Site Health. It can update both address settings for you, but it does not rewrite every stored link in the database. That gap is where most warnings come from, as of November 2026.

Which files does the browser block, and which does it upgrade?

The browser treats some mixed content as blockable and some as upgradable, so the symptoms differ by file type.

MDN explains that browsers should auto-upgrade image, video, and audio requests from HTTP to HTTPS, and block insecure requests for all other resource types. A blocked script or style sheet can break a slider, a form, or the whole layout.

ResourceBrowser actionWhat you see
Plain image, audio, or videoUpgraded to HTTPS when a secure copy existsImage loads, or a console warning appears
Script, style sheet, iframe, or fontBlockedFeature stops, or the page loses its styling
Image in srcset or pictureBlockedResponsive image fails even when the plain image loads
Any resource on an IP address hostBlocked, not upgradedFile never loads

web.dev adds that active mixed content includes scripts, style sheets, iframes, and other code the browser can download and run. An attacker who can change that code can take control of the page.

Passive mixed content is less direct, but it still matters. The same web.dev page notes that an attacker can swap an image, replace a button image, or track which pages a visitor views through insecure image requests.

How do you find every insecure resource on a page?

Open the page in Chrome, open DevTools, and read the Issues tab and the Console to list each insecure address.

web.dev states that Chrome logs detailed mixed content messages in the Issues tab in DevTools, with each insecure resource listed and a restriction status shown. Copy each http:// address before you change anything.

Use these steps on the home page and on one post, one page, and one page with a form or slider.

  1. Open the page over https:// in Chrome.
  2. Press F12, then open the Console tab.
  3. Open the Issues tab and note each blocked or upgraded address.
  4. Repeat the check in a private window after each fix.

Cloudflare's mixed content guide adds that you can also view page source and search for http:// references to other resources. That check helps when a warning appears on pages you did not test in DevTools.

How do you fix the WordPress and Site addresses first?

Change both address settings to https://, because WordPress builds many links from those two values.

Go to Settings, then General in wp-admin. Change WordPress Address (URL) and Site Address (URL) so both start with https://, then save. On most sites the two values are the same, but keep any folder path your install already uses.

If both fields are greyed out, the addresses are set in wp-config.php. The WordPress wp-config handbook says WP_SITEURL defines where the core files live, and WP_HOME defines the address visitors type. Both should include https:// and have no slash at the end.

Add these lines above the line that reads “That's all, stop editing” in wp-config.php, using your own domain:

define( 'WP_HOME', 'https://example.com' );
define( 'WP_SITEURL', 'https://example.com' );

The same handbook warns that these constants override the wp_options table value but do not change the stored value. If you remove the lines later, the old database value returns, so update the database too.

How do you replace old http:// URLs in the database safely?

Replace the old address with a tool that handles serialized data, after a full backup and a dry run.

WordPress stores theme options, widget data, and plugin settings in serialized form, where each string carries its length. A plain SQL REPLACE() can change the text without fixing the length, which can break those settings.

WP-CLI's search-replace page states that the command "intelligently handles PHP serialized data, and does not change primary key values." That is why it is the safe route when you have SSH access.

  1. Back up the full database and the files first.
  2. Run a dry run: wp search-replace 'http://example.com' 'https://example.com' --dry-run
  3. Read the report, then run the same command without --dry-run.
  4. Add --skip-columns=guid so post GUIDs stay unchanged.

The WP-CLI page notes that --dry-run runs the whole operation and shows a report, but does not save changes to the database. Use the exact old address, with or without www, as it appears in your settings.

If you have no SSH access, use a search-and-replace plugin that states it handles serialized data, and run its preview first. Do not run a raw SQL replace in phpMyAdmin on tables that may hold serialized values.

Search your theme files, widgets, and plugin settings for the old http:// address, then change each one at its source.

Common hiding places include a logo URL in the Customizer, a tracking or chat code pasted into a header field, a font link in theme options, and an old embed in a text widget. Fix the setting where it lives, rather than adding a new redirect to cover it.

Check page builder data next. A page built with a builder can store full image and background addresses in its own saved layout, so a post-content replace may miss them. Open the affected page in the builder, save it again, and recheck the console.

If an image still shows as insecure, re-upload it through the Media Library. That gives it a fresh https:// address in the uploads folder, and it also fixes a broken image after a move. See how to fix images not showing if the file itself will not load.

How do you use Cloudflare Automatic HTTPS Rewrites as a safety net?

Turn on Automatic HTTPS Rewrites in Cloudflare, but treat it as a safety net, not as the fix for stored http addresses.

Cloudflare's mixed content guide, updated 2026-10-21, says Cloudflare provides Automatic HTTPS Rewrites as a service that rewrites HTTP resources to HTTPS. It also recommends that WordPress users install the Cloudflare WordPress plugin and enable the Automatic HTTPS rewrites option inside it.

The rewrite only helps when the resource exists over HTTPS. If a third-party file has no secure copy, the browser still cannot load it, and the warning stays.

A redirect loop is a separate Cloudflare problem. If you see too many redirects after changing SSL settings, check the encryption mode in Cloudflare and the HTTPS redirect on your server, and keep only one place forcing HTTPS. For that loop, see how to fix a Cloudflare redirect loop.

How do you force all traffic to HTTPS and check the fix worked?

Add one permanent redirect from HTTP to HTTPS, then recheck the console, the padlock, and several page types.

The WordPress HTTPS handbook says WordPress is fully compatible with HTTPS when a TLS or SSL certificate is installed and available for the web server to use. It also says support for HTTPS is strongly recommended to help maintain the security of logins and visitors.

For the admin area, add define( 'FORCE_SSL_ADMIN', true ); to wp-config.php. The same handbook says this constant forces all logins and all admin sessions to happen over SSL, and that SSL must already be configured on the server first.

Use this checklist after the database replace:

  • Load the home page, a post, and a page with a form over https://.
  • Open DevTools and confirm the Console and Issues tab show no mixed content entries.
  • Check that the padlock appears and that no image, font, or script is missing.
  • Clear the cache plugin and any CDN cache, then check again.

If a warning returns after a cache clear, the old address is still stored somewhere. Search the database again for http://example.com with your real domain, and check the theme and plugin settings for that page.

For broader SSL setup, see Cloudflare SSL settings for WordPress.

For a header that upgrades insecure requests while you finish the cleanup, see how to add a Content Security Policy to WordPress.

When should you contact your host?

Contact your host when the certificate, the server redirect, or the proxy setup is outside your control.

Ask the host if the certificate does not cover your domain or www, if HTTPS works on the home page but not on a subdomain, or if a server redirect keeps sending visitors back to HTTP. Those are server settings, not WordPress settings.

Also ask the host if WordPress sits behind a reverse proxy or load balancer. The WordPress HTTPS handbook notes that a site behind a reverse proxy that provides SSL, but hosted itself without SSL, can fall into an infinite redirect loop. The host can confirm how the proxy passes the HTTPS signal to WordPress.

Before you write, note the exact page, the exact console message, and the steps you already tried. That list lets support check the right log instead of repeating your fixes.

What mistakes should you avoid?

Avoid quick covers that hide the warning while the old http address stays in the database.

  • Do not rely only on a plugin or a Cloudflare rewrite and skip the database replace.
  • Do not run a raw SQL REPLACE() on serialized options, widgets, or builder data.
  • Do not change only one of the two WordPress address settings.
  • Do not add a second HTTPS redirect in another place after the first one works.
  • Do not test only the home page, because a warning can live on one post or one form page.

Fix the stored address, clear the cache, and recheck the console. That order removes the warning at its source instead of hiding it for one visit.

Frequently asked questions

Why does the padlock disappear even though my SSL certificate is valid?

The certificate only secures the page itself. If the page then loads an image, script, style sheet, or frame over HTTP, the browser treats the page as mixed content and removes the padlock. Fix the insecure file address at its source, then clear the cache and reload the page to confirm the padlock returns.

Is mixed content dangerous if only an image is loaded over HTTP?

An image is less direct than a script, but it still weakens the page. An attacker on the same network could swap the image, change what a button appears to do, or track which pages a visitor views. Browsers now upgrade many images to HTTPS, yet the stored HTTP address should still be fixed so the file loads from a secure source.

Do I need a plugin to fix mixed content in WordPress?

No, a plugin is not required. You can fix most cases by changing both WordPress address settings to HTTPS and running a serialized-data-safe search and replace on the database. A plugin or a Cloudflare rewrite can help while you work, but neither replaces fixing the stored HTTP addresses in posts, widgets, theme settings, and builder data.

Why do mixed content warnings return after I clear the cache?

The cache clear can expose a stored HTTP address that the cached page had hidden. Search the database again for your old HTTP domain, check the theme and plugin settings for that page, and look at page builder data and text widgets. Recheck the browser console after each change, and clear the cache plugin and CDN cache again before the final test.

Can I fix mixed content by adding upgrade-insecure-requests only?

That header tells the browser to try HTTPS for insecure subresources, so it can hide many warnings. It does not change the stored HTTP addresses, and it cannot load a file that has no HTTPS copy. Use it as a short-term safety net while you replace the old addresses in the database, theme settings, and plugin settings.

What should I do if a third-party script only loads over HTTP?

First check the vendor site for an HTTPS version of the same file, because most vendors now serve files over HTTPS. If no secure copy exists, replace that script with a secure alternative or remove it. Keeping an HTTP script on an HTTPS page leaves a blocked or unsafe request that can break the page and weaken its security.

Sources

  1. What is mixed content? web.dev
  2. Mixed content MDN Web Docs
  3. Mixed content errors Cloudflare Docs
  4. HTTPS WordPress Developer Resources
  5. Editing wp-config.php WordPress Developer Resources
  6. wp search-replace WordPress Developer Resources

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

WPLegible editors

Researched from the primary sources listed above and checked against our editorial rules. About the site · How we test