Uninstalling a created custom module in drupal 8 I've created a custom module in drupal 8 and on this module i've created:


Content types
Fields
Entities
Views ...


all this programmatically.

But the problem when i try to uninstall it the database keep all this forms stored !!!

I'm wondering if there is a solution to automatically delete them from database when uninstalling a module

I appreciate any kind of help :)
See How to delete a content type, programmatically?

You can add enforced dependencies on any config entity, if you do so, drupal will automatically remove them.

That's much better then using hook_uninstall(), as the user is informed about what will be removed on the uninstall confirm page.