webzod
account

Load images and media over HTTPS on WordPress

headers.resources.mixed_passive · effort: about an hour

Why it matters

http:// images, audio and video on an https page can be swapped or watched on the network, and browsers either upgrade them or mark the page as not fully secure. Switching them to https:// URLs removes the risk and the warning.

The fix

  1. Set WordPress Address and Site Address to https://, then replace old http links in the database with WP-CLI as below (back up and dry run first; run it for each host name the site used).
  2. Edit remaining third-party http:// image URLs in posts, widgets and page-builder settings, then clear caches.
bash
wp db export before-https.sql
wp search-replace 'http://example.com' 'https://example.com' --skip-columns=guid --dry-run
wp search-replace 'http://example.com' 'https://example.com' --skip-columns=guid

The examples use example.com. Replace it with your own domain.

Read the documentation (opens in a new tab)

Scan your domain to see whether this applies to you.