How to Disable Broken Drupal Themes and Modules

tutuploadsmedia_1349380547739.png

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:

tutuploadsmedia_1349380547739.png

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:

  • Login to the Drupal site via FTP.
  • 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:

tutuploadsmedia_1349381322930.png
  • 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:

  • Leave the broken copy of your theme or module in the re-named folder.
  • Go to Drupal.org and download a fresh copy of the theme or module that is broken.
  • 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:

  • Go to the settings.php file for your site. This is often located in your /sites/default/ folder.
  • Open the file and look for the line which says: # $conf[‘theme_default’] = ‘garland’;
  • Remove the # from this line.
  • 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

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

tutuploadsmedia_1349382099500.png
  • Search through the system table to find the theme or module:

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

tutuploadsmedia_1349382163930.png

Solutions 6 and More

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.

Author

  • Steve Burge

    Steve is the founder of OSTraining. Originally from the UK, he now lives in Sarasota in the USA. Steve's work straddles the line between teaching and web development.

0 0 votes
Article Rating
Subscribe
Notify of
7 Comments
Oldest
Newest
Inline Feedbacks
View all comments
danbohea
danbohea
11 years ago

Don’t forget Drush!

kae76
kae76
11 years ago

drush vset theme_default theme_name

Cluemate
Cluemate
10 years ago

thanks….

Anderson Cardoso Silva
Anderson Cardoso Silva
9 years ago

My theme Pixture Reloaded is not showing CSS. I tryed everything but I can´t fix it. The site is [url=http://www.licitacaoecontratacao.net.br]www.licitacaoecontratacao.n…[/url]. As I can see you have databases skill and maybe there is something I can do into it to solve my problem.

Milijana Ristić
Milijana Ristić
9 years ago

This article is awesome

llcsilent
llcsilent
6 years ago

easy copy “template” folder to another default or template that is working, to broken theme an then replace.

Alex
Alex
2 years ago

In Drupal 9 it is awful. so often i get error site after installing stable modules. iam sad. in drupal 6-7  i could deactivate modules simple in database, now it is…. 

7
0
Would love your thoughts, please comment.x
()
x