Mixed content errors are caused by sources (images, scripts, or stylesheets) that are still loading using the insecure HTTP protocol in the URLs.
If that is the case, then you will not be able to see a secure padlock icon in your website’s address bar.
There are two ways to fix SSL / HTTPS mixed content errors in WordPress. We will show you both of them and then you can pick one that works best for you.
1. Fixed mixed content errors in WordPress using a Plugin
This method is easier and is recommended for beginners.
Simply install and activate the Really Simple SSL plugin.
Upon activation, you need to visit Settings » SSL page to review plugin settings. Really Simple SSL works out of the box and will automatically take care of SSL / HTTPS settings and fix mixed content errors.
Note: The plugin attempts to fix mixed content errors by using output buffering technique. This can have a negative performance impact on your site. However, if you are using a caching plugin, then it will only impact the first page load.
2. Manually Fixed Mixed Content Errors in WordPress
This method requires manual troubleshooting, but it is more effective and better for performance.
First, you need to make sure that you are using HTTPS in WordPress settings. Go to Settings » General page and make sure that WordPress Address and Site Address options have HTTPS URLs.
If you see URLs starting with HTTP, then you need to go ahead and change them to HTTPS. Don’t forget to click on the save changes button to store your settings.
Next, you need to find old HTTP URLs in your WordPress database and replace them with the new HTTPS URLs.
You can easily do that by installing and activating the Better Search Replace plugin.
Upon activation, you need to visit Tools » Better Search Replace page. In the ‘Search’ field, you need to add your website URL with HTTP. After that, add your website URL with https in the ‘Replace’ field.
The plugin will now update URLs in your WordPress database.