How To Solve HTTP/HTTPS Mixed Content Error In WordPress Blog

This is a common type of error. Even I faced this issue while setting up HTTPS on this blog using Cloudflare. On checking the Developer Tools console in Google Chrome, I found out that few Javascript files were getting sent over HTTP. That was causing the HTTP/HTTPS mixed content error & messing with the blog layout by blocking some content. The error log looked like below:

Mixed Content: The page at ‘’ was loaded over HTTPS, but requested an insecure script ‘’. This request has been blocked; the content must be served over HTTPS.

To fix this, I had to make a small adjustment in WordPress wp-config.php file & add $_SERVER[‘HTTPS’]=’on’; line as below. And that solved the problem. All the files started getting served over HTTPS.

define( 'WP_DEBUG', false );

/* That's all, stop editing! Happy publishing. */

Leave a Comment