SSL & HTTPS

How to Fix Mixed Content Warnings in WordPress

2 min read

How to Fix Mixed Content Warnings in WordPress

You installed an SSL certificate, but your browser still shows a warning or a missing padlock. In most cases the cause is mixed content: the page itself loads over HTTPS, but some images, scripts or stylesheets are still requested over HTTP.

Why mixed content happens

WordPress stores absolute URLs in the database. If your site used http:// before, many posts, widgets and theme settings still contain old addresses. Hard-coded links in themes and plugins can cause the same problem.

Step 1: Use HTTPS in WordPress settings

Under Settings → General, make sure both the WordPress Address and the Site Address begin with https://. If you cannot access the settings, the values can also be defined in wp-config.php.

Step 2: Update old URLs in the database

Always take a backup first. Then replace the old URLs with the new ones, using a trusted search-and-replace tool. With WP-CLI the command looks like this:

wp search-replace 'http://example.com' 'https://example.com' --skip-columns=guid --dry-run

Run it with --dry-run first to see what would change, then repeat without it. Serialised data needs a tool that understands it, which is why plain SQL replacements are risky.

Step 3: Redirect HTTP to HTTPS

Add a permanent 301 redirect at the server level so that every http:// request is sent to the matching https:// address. Many hosts offer this as a single setting.

Step 4: Find the remaining culprits

Open your browser’s developer tools and look at the Console and Network tabs. Blocked or insecure requests are listed with their address, which tells you whether the source is a theme, a plugin, a widget or your content.

A note on HSTS

HTTP Strict Transport Security tells browsers to use HTTPS only. It is a good security measure, but enable it only after you are sure everything works over HTTPS, because browsers remember the setting.

Interactive checklist: tick off what you have done

  • Backup created
  • WordPress and Site Address use https://
  • Old http:// URLs replaced in the database
  • 301 redirect from HTTP to HTTPS active
  • Browser console shows no mixed-content errors

If your site still shows warnings after these steps, we can find and fix the remaining resources quickly.

Share: LinkedIn X Email

Leave a Reply

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

Related articles