Why my site shows http error even though I have SSL?

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

wpcoworker-fix-http-error-ssl-error-with-search-replace
  1. Once you install the plugin, then navigate to “Tools > Better Search Replace” menu on your website dashboard.
  2. 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 🙂
  3. 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.
  4. 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.

Leave a Reply