Last updated October 16, 2014. Created on July 8, 2007.
Edited by frederickjh, davidneedham, owenpm3, chrisjlee. Log in to edit this page.

If you need to manually disable a module you can do so in the database. Before you start, do a mysqldump (or export) of your Drupal db to a local file in case things go wrong and you need to roll back.

Accessing MySQL

In order to perform these commands one must have access and proper permissions to execute MySQL commands. These commands can be executed with GUI like phpMyAdmin, or just the MySQL command line interface.


To disable a module via phpMyAdmin you must login to phpMyAdmin. Then you must locate the database where Drupal is installed. Once you have done so look for the "system" table. Click and open it. Click to browse the table. Find the record for the module that is causing the problems and select the edit function. Set the status to "0" and save.

MySQL command line

To disable a module using the MySQL command line, run the following SELECT to look at the state of your data before the change. This will help you to find the full name of the module too.

MySQL Commands

See all the modules that have been installed enabled or not:
SELECT name,status FROM system WHERE type='module';

See all the modules enabled:
SELECT name,status FROM system WHERE type='module' AND status='1';

See if a particular module is enabled:
SELECT name,status FROM system WHERE name='module_name';

Disable your module, set the status to 0 for the module name that you want to disable.
UPDATE system SET status='0' WHERE name='module_name';

Enable your module:
UPDATE system SET status='1' WHERE name='module_name';

Check your handiwork using the SELECT statement again.

Drupal 7: Clear Cached System List

On Drupal 7, you must still follow the procedure above to disable the module in the system table. However, data from the system table is cached. This means that even though you updated the system table, Drupal may still think the module is enabled because its cached copy of the system table is not up-to-date.

The cached copy of the system list is in the cache_bootstrap table. Clear the cached copy of the system list as follows.


If you are using phpMyAdmin, find the "cache_bootstrap" table, and delete the record with cid="system_list".

MySQL Command Line

To update the cache using the mysql command line, type:
DELETE FROM cache_bootstrap WHERE cid='system_list';

Looking for support? Visit the forums, or join #drupal-support in IRC.


jahsh’s picture

What are the steps to do this in a postgresql environment?

toreki’s picture

I disabled my broken module in 6.x with replace the .module file to blank file. After this, I disabled it on /admin/build/modules page.

paulmckibben’s picture

In Drupal 7, it was not sufficient for me to merely set status=0 in the system table. I also had to do the following:

DELETE FROM cache_bootstrap WHERE cid='system_list'

Without doing this, Drupal would still think the module was enabled.

Paul McKibben | Mediacurrent

paulmckibben’s picture

I've added the above info to this page.

Paul McKibben | Mediacurrent

featherbelly’s picture

Use something like this:

UPDATE `system` SET `status`='0' WHERE `filename` LIKE '%sites/all%' AND `type ='module' AND `status` ='1';

replaces 'sites/all' with the path to your contrib/site modules folder.

Kester Featherbelly

brayo4’s picture

UPDATE databasename.system SET status=0, throttle=-1 WHERE
(filename LIKE 'sites/all/modules%' ) AND status=1 AND type='module'

replace the database name with your own dbase name.
thanks to’s picture

That worked, thanks

Trollargh’s picture

The core module "update manager" somehow got disabled on a drupal site I was working on and the checkbox was grayed out, so I could not check it. So I went trough the steps mentioned above. I did it manually with phpMyAdmin - the name field in the system table was simply called "update". I set the status to 1 and then deleted the "system_list"record in "cache_bootstrap".

The update manager was working again. But when I looked under modules, I mentioned the red text saying "disabled". The checkbox was checked and it was clearly working.

This is not a big problem, but somehow disturbing me. Does anyone know how to fix it?

torstenzenk’s picture

SELECT name,status FROM system WHERE type='module' AND status='1';

akki123’s picture

Disable your module, set the status to 0 for the module name that you want to disable.
Set schema_version to -1 to uninstall a module so that it will not appear on admin/modules/uninstall page
UPDATE system SET status='0', schema_version='-1' WHERE name='module_name';


humansky’s picture

I'm assuming this method doesn't call hook_install() and hook_uninstall(). Is that correct?

holingpoon’s picture

Yes, your assumption is correct. The method described in this node involves direct manipulation of the database. So, for example, unlike hook_install() and hook_uninstall(), this does not create or drop the field_revision tables.

Smerg’s picture

magnus_n’s picture

I think I misread this guide and accidentally deleted the column 'cid'..
is there a way to create a new one?
This is the code Phpmyadmin wants me to use:
ALTER TABLE `cache_bootstrap` ADD `cid` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Primary Key: Unique cache ID.' AFTER , ADD PRIMARY KEY (`cid`);

but it won't let me create it