Fix Mixed Content After Enabling HTTPS in WordPress¶

After enabling SSL, you might see a browser warning like “Not secure” or a padlock with a warning icon. That’s usually mixed content: the page is loaded over HTTPS, but some assets (images, scripts, CSS) still load over HTTP.
This guide shows the clean way to fix it.
Step 1: Confirm SSL is active¶
Before you fix mixed content, confirm HTTPS works:
- Open:
https://yourdomain.com
If HTTPS does not load at all, fix SSL first.
Step 2: Set the WordPress Site URL to HTTPS¶
In WordPress Admin:
1. Go to Settings → General
2. Update:
- WordPress Address (URL) to https://yourdomain.com
- Site Address (URL) to https://yourdomain.com
3. Save changes
If you get locked out after changing URLs, update them directly in the database (next step).
Step 3: Update URLs in the database (the real fix)¶
Mixed content often comes from old http:// references stored in the database.
Option A: Use a trusted plugin (simpler)¶
Use a well-known search/replace plugin, run:
- search: http://yourdomain.com
- replace: https://yourdomain.com
Then remove the plugin after use if you want to keep the site lean.
Option B: Search/replace with care¶
Search/replace must handle serialized data correctly.
Best practice: - Use WP-CLI search-replace if your plan includes it, or - Use a plugin that handles serialization safely
If you're unsure, stop here and ask GOZEN HOST support. A bad replace can corrupt settings.
Step 4: Force HTTPS with a redirect¶
A redirect ensures all visitors end up on HTTPS.
If your site uses .htaccess, add to the top:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
If you already have WordPress rules, add the redirect above them.
Step 5: Fix remaining asset sources¶
Common culprits:
- Hardcoded image URLs in your theme
- Elementor/Builder templates storing
http:// - CSS files referencing
http://backgrounds - External libraries served over HTTP
Use your browser dev tools:
- Open Console or Network tab
- Identify which assets load over http://
Then fix at the source (theme settings, builder templates, etc.).
Step 6: Purge cache and CDN¶
After changes: - Clear WordPress cache plugin - Purge CDN cache (Cloudflare) - Clear browser cache
Summary¶
Mixed content is fixed by aligning everything to HTTPS: confirm SSL → set site URLs → update database references → force HTTPS redirect → fix hardcoded assets → purge cache.