Ever saw an error like “Page Contains Secure and Nonsecure Items” while trying to browse the SSL secured pages on your website? If the issue happens even after installing an SSL certificate from the best SSL certificate provider out there, there is something wrong, right? Something isn’t working as expected. That’s exactly what we are going to break down today.
The “Page Contains Secure and Nonsecure Items” error in SSL pages occurs due to some resources used on that page is being loaded from the HTTP version instead of the HTTPS. This happens mostly when migrating from the HTTP to HTTPS and few or most of the contents are still being served from the HTTP URL instead of the HTTPS version.
In some of the cases, the problem may also occur due to some external resources serving the content from the non-secured version. In such cases, you should either stop using any of the services from those websites or try to fix the issue on a PC level. Either way, we can fix the “Page Contains Secure and Nonsecure Items” error without sweating much. Here are 5 methods to fix the problem.
The first four methods are useful if you want to fix the problem on your own website so that no one else will experience the same problem on your site. In the last method, we described how you could fix the Page Contains Secure and Nonsecure Items error on a PC or browser level. Remember that, this will not fix the problem on any other computer without doing the same tweaks.
Method 1 – Check if the files are served from HTTPS
After installing an SSL certificate or migrating your website to the SSL version, you should serve all the content from the HTTPS version. For this, inspect the elements of your web pages using a browser and see the URL of the sources. For example, for an image, the code should look something like this.
<img src="https://www.yourdomain.com/image.jpg" alt="" />
If it is being served from the HTTP version, you should change the resource URLs. This can be usually accomplished by directly editing the content or replacing the URLs in the database altogether.
Method 2 – Change all links to //
Similar to the method described above, you could simply add // in the URL of the resources in order to make it automatically select the version.
<img src="//www.yourdomain.com/image.jpg" alt="" />
This tells the browser to use the current protocol of the website instead of a hard coded version. If the page is being loaded from the HTTP version, the resources will be served from HTTP. If the page is loaded from the HTTPS version instead, so does the resources.
Method 3 – Make the links relative
If the resource that makes the problem is served from the same domain, you could simply use the resource name like shown below. In other words, you can use the relative path to the resources without including the root domain.
<img src="image.jpg" alt="" />
Method 4 – Fix mixed content issue on WordPress
If you are using a WordPress website and has the Page Contains Secure and Nonsecure Items error, there is a very simple fix for you. Just download and install the SSL insecure content fixer plugin from the WordPress repository and configure it as per the steps provided in the plugin documentation. It is extremely easy to configure and nothing difficult at all.
In addition to that, if you just migrated your website from the HTTP version, you can use plugins that allows replacing the URLs in the database to the HTTPS versions. Better Search Replace is such a reputed plugin to do such database replacement queries.
Method 5 – Change the browser settings on PC level
Here comes the last method, which fixes the Page Contains Secure and Nonsecure Items problem in most of the cases. In other words, if you just want to avoid the problem without getting deeply into it, this one is the best option.
Keep in mind that, this will not actually fix the problem. It just hides it. The method will be useful if one of your favorite websites that you frequently use has the insecure content issue. Because you cannot fix it yourself, you could either contact the webmaster or apply this fix. Here are the steps to fix the issue on a browser level –
- Search “Internet Options” in the search box on start.
- Click on the “Internet Options.”
- Navigate to the Security Tab.
- Click the Custom Level button.
- A new window will open up. Scroll down and find an option namely “Display mixed content.”
- In the radio button under that option, select Enable.
- Click OK. If you get a security warning, click Yes.
Page Contains Secure and Nonsecure Items problem is fixed now, and you can continue browsing your website or any other website without receiving this annoying error. If you are still facing the problem and need further assistance, feel free to contact us. We will always be happy to assist you.