Fix HTTP Issue in WordPress When Migrating to HTTPS. CSS or JS Resources Not Loading.

Tiempo de lectura: < 1 minuto

Reading time: < 1 minute

Today, I’m going to show you how to fix the WordPress issue when migrating a site with SSL HTTPS and encountering the message “Mixed content blocked: WordPress”. This issue typically affects JSON and CSS files.

This problem prevents the CSS or JS resources from loading on our WordPress website.

To fix it, follow these steps:

  • Go to the wp-config.php file

Add the following code:

if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') $_SERVER['HTTPS']='on';

Place it before the line:

/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';

This will force the content to load over HTTPS, preventing the mixed content message or insecure website warning in Chrome.

Additionally, it will allow you to access the admin panel again.

Leave a Comment