How can I track how embedded media is used across my site? My site uses the core Media module, Entity Embed, and LinkIt to reference media and other entities in various ways.

I want to keep track of which media is embedded on which nodes.

I tried adding an entity reference field to media on my content types, but this means that I have to add the media twice: to the field where I actually embed the media and to the entity reference field to track it.

Is there a better way?
First, there is a core issue to eventually get this into core.

Now, the best way is to use the Entity Usage module, which can handle tracking of media and many other cases.

Hats off to the module maintainers-- this is all I needed to do to implement my use case:


Download the module with composer.
Enable the module.
Go to /admin/config/entity-usage/settings and check Media under Enabled local tasks.