With search engines such as Google advocating for more secure websites, website owners are installing Secure Sockets Layer (SSL) certificates on their websites. An SSL certificate creates a secure connection between the website and the visitor’s browser. For most websites, installing the SSL certificate forces the web server to send all data over the secure connection. For content management systems such as WordPress, extra steps are required to fully secure the website. Read on to discover how to fix mixed content messages on WordPress.

Why mixed content?

To understand why WordPress outputs mixed content, you have to look at how WordPress stores content. Like most content management systems, WordPress stores links to content inside a database. These links consist of a URL that points to a file location on the web server. For WordPress websites that were created before installing the SSL certificate, the database contains a link that contains http (insecure) instead of https (secure). Also, some plugins hard code links using http.

To fix the mixed content issue, you can install a plugin (such a Really Simple SSL) that forces the web server to change all http links to https links before sending them to the visitor’s browser. This type of fix is not a permanent fix and can lead to some performance issues (especially on a website with a lot of mixed content).

Change database entries

The approach we take is to search the database and replace all instances of http with https. For this activity, we have found that the Better Search and Replace plugin provides the most reliable search and replace functionality to fix mixed content messages. The plugin defaults to conducting a ‘dry run’ of the search and replace so you can visually check the results before updating the database.

Better Search and Replace

We enter http:// in the search field and https:// in the replace field. Ensure that you include the ‘://’ in both fields. If you just use http and https without the ‘://’, the plugin will replace any instances of https with httpss (note the double s) and will cause your website to stop functioning properly.

Verify the changes

Click on the padlock to verify that your connection is secure.

With the database updated, test your website by visiting several pages of your website to ensure that the content is fully secure. Most web browsers display a padlock next to the website address bar. Follow the steps outlined above to fix mixed content messages on your WordPress website.

Need help to fix mixed content messages on your website?

Let’s chat!

Feel free to share this post.

Facebooktwitterlinkedin