Programmatically disable a module - Drupal 8
You can run the following code using
$module_data = \Drupal::config('core.extension')->get('module');
// Unset the modules you do not need.
unset($module_data['dblog']);
// Write the configuration.
\Drupal::configFactory()->getEditable('core.extension')->set('module', $module_data)->save();
drush eval
or may be using the Devel module's provision to Execute PHP Code
.$module_data = \Drupal::config('core.extension')->get('module');
// Unset the modules you do not need.
unset($module_data['dblog']);
// Write the configuration.
\Drupal::configFactory()->getEditable('core.extension')->set('module', $module_data)->save();
Comments