Every once in a while, users are irritated because they unpublished a document or an image in Drupal's media library - but the document or image file URL is still accessible and also shows up in search results – what the heck?!
I just wrote down some notes about what happens here and how you can easily circumvent this unwanted behavior by means of the all-rounder tool ECA:
https://www.tojio.com/en/blog/drupal-media-files-and-how-control-their-visibility