Many a times I have observed people asking – “my site has SSL but it still shows http error” OR “my site has SSL certificate but I still get privacy error”. The reason is you are loading mixed content on your website. By mixed content I mean loading some assets with http and some with https.
To resolve this you will need to search-replace all http URLs with https. You can do it in two ways:
Fix http error / ssl error using a search replace plugin like Better Search Replace
- Once you install the plugin, then navigate to “Tools > Better Search Replace” menu on your website dashboard.
- In the ‘search for’ field you need to input http://example.com/ and in the ‘replace with’ field you need to input https://example.com/ Notice the http in former and https in later. Also you are supposed to replace example with your actual domain name 🙂
- Select both “Replace GUIDs?” and “Run as dry run?” checkboxes. The dry run setting will first show you the changes to be made before they are actually made. This gives you a chance to review.
- Once you review, uncheck the “Run as dry run?” checkbox and click on “Run Search/Replace” button. This time actual search-replace will be performed as per the URLs you input.
Fix http error / ssl error using WP CLI command
wp search-replace "http://example.com/" "https://example.com/" --dry-run --report-changed-only
The above command will not make the changes rather it will first show you the changes to be made. Once you are sure run the same command but this time remove –dry-run flag. Like below:
wp search-replace "http://example.com/" "https://example.com/" --report-changed-only
Please ensure you take the website backup before you do this. Hope this helps.