WordPress admin not loading css/js

I’m having a problem with the admin on a WordPress site. I’ve scoured the interwebs and seen lots of other people with the same problem, but no definite solution. The admin is showing like this:

enter image description here

Read More

And when I inspect it, I get a 500 (Internal Server Error) on both load-styles.php and load-scripts.php

Anyone know what’s up, and how to rectify?

Related posts

Leave a Reply

10 comments

  1. Just to keep everything in one answer, this worked for me:

    define('FORCE_SSL_LOGIN', true);
    define('FORCE_SSL_ADMIN', true);
    define( 'CONCATENATE_SCRIPTS', false );
    define( 'SCRIPT_DEBUG', true );
    

    After page refreshing and it looks OK, maybe after re-login, set SCRIPT_DEBUG to false.

    Don’t forget about those last two settings if you’re using a plugins for debugging or site optimization – though such plugins might override those settings.

  2. Also had similar issues that affected custom fields and elementor plugins only after upgrade to the latest version of wordpress (5.5.1).
    It was affected by the theme used (not developed by me). Switching between a default theme fixed the problem.
    There were no errors displayed or logged.
    Also project in live server without xdebug or other means of debugging except plain old way.

    A simple change made, were there is no more ‘type=”text/css”‘ in the tag and the use of a pregmatch filter was the problem 🙂

    preg_match_all("!<link rel='stylesheet's?(id='[^']+')?s+href='(.*)' type='text/css' media='(.*)' />!", $input, $matches);
    

    fix:

    preg_match_all("!<link rel='stylesheet's?(id='[^']+')?s+href='(.*)' (?:type='text/css')*media='(.*)' />!", $input, $matches);
    

    Found e perfect inspiration here enter link description here.

  3. the CSS was not loaded in my case ( with WordPress 3.7.1) because of an encoding problem.

    Force UTF-8 encoding by replacing in wp-admin/load-styles.php the corresponding line by :

    header('Content-Type: text/css; charset=UTF-8');
    
  4. In wp-config.php file you can add – define( ‘SCRIPT_DEBUG’, true);
    This solves the problem but, it is not good practice to leave this config on true while on production.

    Hope it helps

  5. I was having a similar issue with a new installation of WordPress that needed redirecting to a temporary url.

    My solution was to make sure the siteurl and home url had the http:// at the beginning of the url.

    Hope it fixes it.

  6. PHP Memory Limit could also be the problem, if it is too low for the page loading in backend, WP simply stops loading scripts. Setting up MemoryLimit 256->512 worked for me…

  7. Using Lightsail with wordpress bitnami and wp-rocket here. Too specific to be honest.

    The problem was the cache, wp-rocket is not compatible with mod_pagespeed.

    The solution was to purge the mod_pagespeed cache

    sudo touch <installdir>/apache2/var/cache/mod_pagespeed/cache.flush
    

    Then

    sudo <installdir>/ctlscript.sh restart apache
    

    And after, disable the mod, commenting out the following lines in the <installdir>/apache2/conf/httpd.conf file:

      #Include conf/pagespeed.conf
      #Include conf/pagespeed_libraries.conf
    

    and restart for second time apache

    sudo <installdir>/ctlscript.sh restart apache
    

    Where <installdir> was /opt/bitnami, could change for multisite, if I’m not wrong

    Source wp-rocket incompatibility

    Source disable mod_pagespeed

  8. i know this is an old post
    but maybe i can help other who are having the same issus

    before you put another codes in you wp-config file , make sure that the folder wp-content permissions is 755