Skip to main content
2 of 4
edited title
Sugandh Khanna
  • 3.5k
  • 5
  • 40
  • 69

How to forcefully uninstall any module having content in it, ex: fields, nodes, or any entity?

I wanna uninstall Field module but this module can not be uninsalled, showing:

Field API to add fields to entities like nodes and users.
Machine name: field
Version: 8.0.6
Required by: TextNodeAdmin ToolbarAdmin Toolbar Extra ToolsFileOptionsAggregator (disabled)ImageAccelerated Mobile Pages (AMP) (disabled)Custom BlockBook (disabled)Text EditorCKEditorCommentInterface TranslationConfiguration Translation (disabled)

How to forcefully uninstall any module that is having dependency or content inside.

For ex: node, views or any entity having content in it. I tried using

\Drupal::service('module_installer')->uninstall(['admin_toolbar']);

but when done for modules having content inside, my site breaks, saying unexpected error.

Sugandh Khanna
  • 3.5k
  • 5
  • 40
  • 69