My module creates its own text format upon installation by having a file named config/install/filter.format.{format}.yml.

However, I can't uninstall and reinstall the module, because the format persists and will then cause a conflict. ("... already exists in active configuration.")

This looks like a bug in the filter API, but maybe there is some explicit way to delete the format when the module is removed? It's really annoying to have to manually delete the config key every time.


2 Answers 2


You need to add a dependency in your filter format to the module. Then when the module is uninstalled, the format should get deleted

  • Thanks, this works! (I should note that Drupal will then stop you from uninstalling the module unless you disable the text format manually first, but that's a reasonable precaution.) Dec 1, 2015 at 22:17
  • 1
    Doesn't seem to work anymore. Despite having dependency on module that installs the format, it's not deleted anymore. And the module can not be installed again due to "filter.format.* already exists in active configuration". Jun 9, 2016 at 10:19

Text formats are undeletable.

@see this 8.0.x-dev issue: Change the disable user interface with formats. Make it remove.

Berdir's answer:

It is called disable because it's not deleted, it stays there as a format is undeletable, you'll just never be able to get it back ;)

There have been endless and insane discussions and issues around this before the release of 7.x. Headache-causing discussions ;)

Wim Leers' answer:

To clarify Berdir's points: text formats may not be deleted because almost always there's >0 pieces of content using it, which must still be renderable, which means that the text formats they use must remain available. Hence text formats can only be disabled.

Maybe in the future there'll at least be the option to re-enable them.

@see this 8.5.x-dev issue: Disabled text formats can't be seen in the GUI.

  • Hi, sorry but this isn't really the solution as uninstalling the module requires all its config to be removed completely. larowlan's answer is correct here - adding the dependency will either remove the format or prevent uninstalling if it is still in use. Oct 11, 2017 at 8:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.