Restrict element deletions 2.x
This plugin can prevent deletion of elements (entries, assets, categories and users) if they are referenced in other elements. This plugin is also integrated to Commerce so can prevent deletions of products as well.
The idea is taken from the plugin Restrict Asset Delete, improved to apply to all elements, and made Craft 4 ready.
Please visit the settings page to learn how to define policies to restrict deletions.
Prior to Craft 4.3 the button delete on an index element page will still be active even if you're not allowed to delete. This is discussed here.
The deletion is prevented anyway, just the button isn't disabled. This is working properly from Craft 4.3 on.