Images causing Mixed Content with SSL

I’m trying to use SSL on my login pages but I have some images on this page and it also looks like it’s loading a Google Font API so it’s not saying the page is secure.

I tried to force SSL using:

define('FORCE_SSL_ADMIN', true);

However, I’m still getting the mixed content. I also tried to update my Site and Home URL to be https instead of HTTP but still getting mixed content. I even installed the WordPress HTTPS plugin and still getting mixed content.

2 Answers
2

Use the developer tools in Firefox (or Firebug) or Chrome or Safari or IE to see the errors with specific images.

1) You may need to change URLs of media items in the post/page content to https. Search RegEx is a good plugin to be able to search and replace (optionally with grep) through all posts, pages, excerpts, comments, titles and meta. And, interconnectit.com WordPress Serialized PHP Search Replace Tool can be used to find/replace in the entire database, i.e. metadata, GUIDs and widget content, etc.

2) You may need to change to a relative path for images in CSS files, i.e. background-image: url(http://example.com/themes/wp-content/theme/images/image.jpg) to background-image: url(images/image.jpg)

3) You may need to remove the http from absolute paths in php theme files, i.e. change 'http://example.com/image.jpg' to '//example.com/image.jpg'; that will allow your resources to default to https.

Leave a Comment