To combat this problem, I would recommend installing either WordPress Force HTTPS or WP Force SSL.
]]>Use this script:
https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Search for https://example.com
and replace with https://example.com
.
Clear any cache and you’re done.
]]>