New 24/7 monitoring and daily cloud backups now included in every Shield Pro plan.

Mixed content

How to fix WordPress mixed content warnings

Mixed content means your page loads over HTTPS but images, scripts, or CSS still use HTTP. Browsers block insecure assets and show padlock warnings. This tutorial shows how to find and fix http URLs without breaking serialized data.

Time: 30-60 minutes Level: Intermediate

What this problem looks like

Mixed content often appears after SSL is enabled but WordPress still stores http links in post content, widgets, and theme customiser fields. Page builders and old image URLs in the media library are frequent sources.

Fix certificates and redirects first, then hunt http strings. A database search-replace fixes bulk content, but hardcoded URLs in theme files need manual or FTP edits.

Never run database search-replace on production without a backup. Bad replaces on serialized PHP data can break widgets and theme options.

Step 1: List blocked assets in browser DevTools

Load an https page, open DevTools → Console, and look for Mixed Content warnings. Each line names an http URL. Screenshot the list before you change anything.

  • Images in old posts and featured images.
  • CSS or JS from plugins with hardcoded http CDNs.
  • Background images in page builder sections.
  • Google Fonts or analytics scripts loaded insecurely.

Step 2: Confirm WordPress generates https links

In wp-admin go to Settings → General. Both URLs must use https://. If admin will not load, set constants in wp-config.php:

php
define( 'WP_HOME', 'https://example.com' );
define( 'WP_SITEURL', 'https://example.com' );
Use the canonical hostname you want in Google Search Console, either apex or www, not both without redirects.

Step 3: Search-replace http URLs safely

On staging or with backup, use WP-CLI dry-run first:

bash
wp search-replace 'http://example.com' 'https://example.com' --all-tables --dry-run
wp search-replace 'http://example.com' 'https://example.com' --all-tables

Step 4: Fix theme and widget hardcoding

Search theme files for http:// via SFTP or use a plugin like Better Search Replace for specific tables. Check Text widgets, Custom HTML blocks, and page builder global settings.

Step 5: Clear all caches and verify

Purge host cache, optimisation plugin cache, and Cloudflare. Test checkout, forms, and login. Mixed content on cart pages can block payment scripts in strict browsers.

When to stop DIY and hire help

Large legacy sites with page builders and thousands of http URLs are tedious to fix by hand. BugShield resolves mixed content and SSL alignment at a confirmed fixed price.

FAQs

Why is mixed content still showing after SSL?

Old http URLs remain in the database and cached HTML. Search-replace content and purge every cache layer.

Will a mixed content plugin fix everything?

Plugins can rewrite output on the fly but do not fix stored http URLs. Correct the database and assets for a permanent fix.

Can I use // protocol-relative URLs?

Protocol-relative URLs are outdated. Use explicit https:// for all assets on modern sites.

Does mixed content hurt SEO?

Browsers may block resources, hurting user experience and trust signals. Google prefers fully secure pages.

Rather someone else fixed it?

Request a fix at a confirmed price. Named UK developer, secure Vault, direct chat.

Request a Fix