After switching to HTTPS, you might have faced below problems
- Green lock not showing, instead Insecure warning
- Mixed content warning in the console logs
This all happens due to mixed content.
Facts: When we use HTTPS for our website, the browser expects to load each and every element in the HTTPS version only. This is a reason, why even one non-secure element, cannot be loaded while using HTTPS
Okay, no worries. Here’s the ultimate fix for resolving all these issues quickly in next 5 minutes. Keep reading.
Before you begin, I would highly recommend please take backup of your WordPress site. As changes done by this process into Database cannot be reverted easily.
Now, install and activate “Better Search Replace” Plugin.
Go to Plugin UI: Tools > Better Search Replace
Only for shared hosting user: Before you start using, please go to Settings > Drag max page size to 1000.
For high quality hosting like Cloudways, Kinsta, VPS then probably no need to worry.
Now, go to Search/Replace menu, you will see something like this.
To fix mixed content error, you need to replace all HTTP version URL to your canonical version. See example.
Migrating from http non-www to https www version
Migrating from https non-www to https www version
Finally, Migrating from http www version to https www version
Each time while replacing, must select all Database tables.
Tip: Click on first one, and then hold SHIFT and press END key from your keyboard.
Keep Uncheck Dry run, and also check Replace GUIDs
Run Search/Replace to begin process of Search/Replace. It may take some time, depending on Database size.
Now, it’s time to see the result.
Using Cloudflare? You can also use “Automatic HTTPS rewrite”. However, I recommend above permanent method not shortcut.
Green Lock, no warning.
Hopefully, these little steps will replace all HTTP version link to the HTTPS, and fix mixed content/insecure warning that you may be receiving after switching to HTTPS.
Thanks & Regards,