How to Correctly Fix Mix Content Issues on WordPress

Dealing with mixed content issues on WordPress sites can be a pain. The ideal way to solve mixed content issues is to solve those at the database level, so it does not need another plugin dependency to fix mixed content on the site’s front end.

If you want a plugin-only solution, then the Better Search Replace plugin will help run a search and replace any HTTP references in the site’s database and change those to HTTPS.
Depending on the number of references that need to be changed, the Better Search Replace plugin might take a while to complete the changes.
If you run an e-commerce store using WooCommerce, you should skip the session database table from being included in any search and replace it.

Before making any database changes, it is always recommended to make a database backup using a backup plugin so you can quickly restore it if needed.
If you are comfortable with WP-CLI, then you can run a search and replace in the WordPress site’s database from the command line to test and run a dry run using:
wp search-replace 'http://example.com' 'https://example.com' --dry-run
When you are ready to run the full search and replace, then use:
wp search-replace 'http://example.com' 'https://example.com'
It is recommended to flush permalinks, clear any CDN used on the site, and clear any full-page caching that you might have active on the site.
Permalinks can be flushed from wp-admin or using a WP-CLI command;
wp rewrite flush
If you have Redis object caching on WordPress, you can purge that from wp-admin as well as clear it from the WP-CLI command;
wp cache flush
Running a search and replace, flushing permalinks, and clearing all site caches should solve most mixed content issues, but there may be edge case issues caused by site assets being loaded on active plugins.
Edge issues caused by plugins can be found by checking the site using a site testing service such as GTmetrix or WebPageTest. Assets with loading issues will show in the waterfall results that can be reviewed to resolve.
Useful Links
Share
Manage Unlimited WordPress Sites from One Dashboard!
- Privacy-first, Open Source, Self-hosted
- Easy Client Management
- 15+ & 30 + Premium Add-ons
- Bulk Plugins & Themes Management