WordPress Mixed Content Errors After SSL

Seeing insecure content warnings after installing SSL? Fix mixed content errors in WordPress.

What is Mixed Content?

When HTTPS site loads some resources (images, scripts, CSS) via HTTP instead of HTTPS.

Browser Warnings

  • Padlock icon with warning
  • “Not Secure” message
  • Shield icon in address bar
  • Content blocked message

Solution 1: Update Site URLs

Via WordPress Admin

  1. Settings → General
  2. Change WordPress Address to https://
  3. Change Site Address to https://
  4. Save Changes

Via wp-config.php

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

Solution 2: Update Database URLs

Using Better Search Replace Plugin

  1. Install Better Search Replace
  2. Search for: http://yourdomain.com
  3. Replace with: https://yourdomain.com
  4. Select all tables
  5. Run as dry run first
  6. Run actual replacement

Via WP-CLI

wp search-replace 'http://yourdomain.com' 'https://yourdomain.com' --all-tables

Solution 3: Force HTTPS via .htaccess

Add to top of .htaccess:

RewriteEngine OnnRewriteCond %{HTTPS} offnRewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Solution 4: Force HTTPS in WordPress

Add to functions.php:

function force_ssl() {n  if (!is_ssl()) {n    wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 301);n    exit();n  }n}nadd_action('template_redirect', 'force_ssl');

Solution 5: Fix Content Security Policy

Add to .htaccess:

Header always set Content-Security-Policy "upgrade-insecure-requests;"

Solution 6: Use SSL Insecure Content Fixer Plugin

  1. Install SSL Insecure Content Fixer
  2. Activate plugin
  3. Settings → SSL Insecure Content
  4. Select fixing level
  5. Test site

Solution 7: Update Hard-Coded URLs

In Theme Files

  1. Search theme files for http://
  2. Replace with https://
  3. Or use relative URLs (/path/to/file)

In Widgets

  1. Check all widgets
  2. Update any HTTP URLs
  3. Use relative URLs

Solution 8: Fix External Resources

Google Fonts

Change from:

<link href="http://fonts.googleapis.com...">

To:

<link href="https://fonts.googleapis.com...">

Or Use Protocol-Relative URLs

<link href="//fonts.googleapis.com...">

Solution 9: Check for Mixed Content

Browser Developer Tools

  1. Open site in Chrome/Firefox
  2. Press F12
  3. Check Console tab
  4. Look for mixed content warnings
  5. Fix reported URLs

Online Tools

  • WhyNoPadlock.com
  • JitBit SSL Checker

Solution 10: Update CDN URLs

If using CDN:

  1. Log into CDN account
  2. Update origin URL to HTTPS
  3. Enable SSL on CDN
  4. Purge cache

Final mention: Please feel free to contact us for SSL migration help.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *