This is another helpful guest post from OSTraining. The topic today is how to disable broken Drupal themes and modules.

It's happened to all of us who use Drupal. We've installed a new theme or module and our beautiful homepage now looks like this:

Drupal error message

Here are ways you can try to solve this problem and get your site back online.

These solutions are a good place to start but none of them will work for everyone. The right solution for your site will depend on which version of Drupal you're using, what modules and themes you have installed and which part of the site is broken.

Solution 1: Disable via the admin

You can try to visit the admin area directly by using URLs. For example, you could try to add /admin/ to your site's URL.

If this works, you can disable the theme or module directly from the admin area. However, this won't work if you aren't logged into the site,

Solution 2: Disable the files

You can disable themes and modules via FTP. This process works best with modules. With themes, it works only with Drupal 6. With D6, by breaking the Danland folder, Drupal should ignore the theme and revert back to Bartik. This will allow you to login again.

In this example, the Danland theme has thrown an error and I need to disable it. Here's the process:

  1. Login to the Drupal site via FTP.
  2. Browse to the /site/all/themes/ folder. This is the normal Drupal folder for installed themes, but you can also get a hint on where your problem is by looking at the error message on your site:

    Drupal error message

  3. Rename the themes folder. In this case, you can rename the /danland/ folder to /danland-error/

Solution 3: Re-upload the files

If Solution 2 doesn't work for you, what you can do next is this:

  1. Leave the broken copy of your theme or module in the re-named folder.
  2. Go to Drupal.org and download a fresh copy of the theme or module that is broken.
  3. Upload the fresh copy of the theme or module to replace the one that you just disabled.

Note: this will only work for themes and modules that are available on Drupal.org, not for custom ones.

Solution 4: Disable via settings.php

This only work for themes:

  1. Go to the settings.php file for your site. This is often located in your /sites/default/ folder.
  2. Open the file and look for the line which says: # $conf['theme_default'] = 'garland';
  3. Remove the # from this line.
  4. Save the file.

That should make Garland into your site's default theme. You'll be able to login to your site again and disable the broken theme.

Solution 5: Disable via the database

  1. Login to your Drupal database. In this example, I got access to the database by using PHPMyAdmin from the hosting company.
  2. Look for the system table in the database.

    System database in Drupal

  3. Search through the system table to find the theme or module:

    Find Drupal module info on system table

  4. You can disable the theme or module from here, by changing the status field from a 1 to a 0.

    Changing status of broken module in Drupal database

Solutions 6 and More

Drupal.org has a useful page with more ideas on fixing broken themes: http://drupal.org/node/200774

Please note

  • If your error message isn't showing a path to the /sites/, you may not have a problem with a theme or module but with another part of your site.
  • If your site simply shows you a blank page, you may need to either try and roll back the latest changes to your site, or
  • Please tell me you didn't forget the golden rule of running a site: BACKUP! BACKUP! BACKUP! BACKUP! BACKUP! Check to see if a backup of your site is available.

You can see the original post here: http://www.ostraining.com/blog/drupal/broken/

Subscribe to our mailing list

* indicates required