Refreshing "Referenced by the following items" for media and content

Greetings all,

For our needs we rely quite heavily on “Referenced by the following items” for content and media and I noticed that it is not always available/up to date. Especially when restored to a DEV environment.

Is there a way to make the CMS refresh all these relation references without having to save and publish each node/media item? Or should I just write a script that goes through the whole site using the API?

Thank you!
Genc