I got a ticket from our stakeholders that certain outdated PDFs are googlable, and this is causing problems with people going on old information.
Navigating to admin/content/files
, I am able to find entities(?) for the files, by searching on their filename and extension (MIME type). There is also a seemingly handy column "Used In". However, when I click through the values in the "Used In" column (e.g. "2 places"), the paths are like render elements or something similiar: {Content Type} > Paragraphs (previous revision) > Column Content (previous revision) > Column Wrapper Content (previous revision) > Accordion Section (previous revision) > Accordion Section Body
.
From this information, I am not able to navigate to the page where the file resides, in order to remove it.
Furthermore, one of the files is used in 0 places, and there appears to be no interface that allows me to delete it. I am able to open the PDF from the file path link in an incognito window, so I conclude that, even though a user can't discover this PDF by navigating on our site, they still might get to it through a google search.
My question is different from this similar question, How do I delete files the correct way?, because in that question, the asker already knows which node it is that contains the file they want to delete. In this case, I don't know where on the website the file is actually attached. I'm trying to get that information.
One proposed solution might be to google for the files, and find out where on our site they are from Google's search results, but I want to know how to delete these files through Drupal, so in a future case, where I can't find them through google, I still have a way to delete them.
Edit even after googling search terms for the files, I find that the top search results are direct links to the PDFs themselves. So even using google, I'm not able to determine which page or URL on our site has them on.
How do I delete these files, listed in the "Files" tab of the admin content screen?
Edit 3 So Clive's first answer "didn't work" for me, because it turns out, as Clive deduced, that the reference to the files were broken. But I was able to confirm that the code did indeed work by testing a node whose attached image I was certain of. I've deleted "Edit 2" expounding on the broken reference information I got from the code.