Guides

How to fix mixed content after switching to HTTPS

Mixed content is when a page loads over https but pulls some resources (images, scripts, styles) over old http. Because of that the browser shows a padlock with a warning or blocks those resources, and the layout can break. Fix it right after the switch to HTTPS.

Check your site

>
  1. Find what is loading over http

    Open the site, press F12, and look at the Console tab: the browser names mixed content and the exact file URLs. Chrome DevTools also lists them under the Security tab.

  2. Replace http links in your content

    The usual culprits are hard-coded links in posts and the theme. Run a database replace (Better Search Replace or WP-CLI search-replace), changing http://your-domain to https://your-domain.

  3. Check the template and theme settings

    Look into header.php, footer.php, and theme options: logos, background images, and font includes often carry absolute http URLs. Change them to https or to protocol-relative paths.

  4. Fix external resources

    If a third-party script or font loads over http, switch the URL to the https version of the same source. If the source has no https, find a replacement, because modern browsers will simply block it.

  5. Add a safety-net header (optional)

    A Content-Security-Policy header with the upgrade-insecure-requests directive tells the browser to fetch http resources over https instead. Treat it as a backup, not a substitute for cleaning up links.

  6. Clear cache and re-check

    Purge the page cache, LiteSpeed Cache, and CDN, then reload with Ctrl+F5. Test several page types: home, an article, a product page.

How to verify the result

The browser padlock should show no yellow triangle and the Console no mixed content messages. Run the site through the TechGuard security headers check to confirm a proper CSP is in place.

Tip: Do not silence the browser warning or ignore blocked scripts: forms, sliders, and analytics can quietly stop working because of them.

Related guides

Found problems?

Slow hosting, SSL trouble or frequent downtime? Move to TomisHost: fast hosting with free SSL, daily backups and free migration help.

TomisHost hosting