The Composite Reference module allows users to mark entity reference fields as composite.

Composite reference fields ensure that referenced entities get deleted when the referencing entity is deleted.

The deletion is prevented if the referenced entity is referenced by another entity but typically you should ensure you only use this capability for entities that can be referenced only once.

How to

The module works with both Entity Reference and Entity Reference Revisions field types.