Disable Rules Programmatically in Drupal 7

By junaid on Fri, 04/10/2015 - 14:08

Rules are a powerful module, which can be used to construct very complex workflows within a Drupal site. Several of contributed modules comes with pre-built rules as part their functionality. Sometimes we may need to disable rules brought by some contributed modules that we used in our site. Disabling a rule through configuration is very easy, just go to rules configuration page, then clicking on 'disable' link work.

Changing just configuration is not good practice as we need to ensure it reaches all developers and different environments like dev, staging etc, especially on large projects having more developers working collaboratively. So we need to ensure that disabling rules also are propagated properly from development to live.

KB Article