How to fix WordPress mixed content issues (HTTPS) Print

  • 0

Overview

Mixed content happens when your website uses HTTPS, but some files (images, CSS, JS) still load over HTTP. This causes warnings and breaks the padlock icon.

1. Install and enable SSL

Before fixing mixed content, make sure SSL is active:

  • DirectAdmin → SSL Certificates
  • Select Let's Encrypt
  • Enable Force SSL

2. Update WordPress URLs

Edit wp-config.php:

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

3. Force HTTPS for all images and links

Install the Really Simple SSL plugin:

  • Go to Plugins → Add New
  • Search for “Really Simple SSL”
  • Activate

4. Replace old URLs inside the database

Use a search-and-replace plugin:

  • Better Search Replace
  • WP-CLI (advanced)
http://yourdomain.com → https://yourdomain.com

5. Clear all caches

  • LiteSpeed Cache → Purge All
  • Cloudflare → Purge Everything (if enabled)

6. Fix mixed content manually (optional)

Use your browser console → search for blocked resources (HTTP URLs), update links in:

  • Theme settings
  • Page builder elements (Elementor, WPBakery)
  • Custom CSS/JS

Was this answer helpful?

« Back