Bulk delete attachments in Zotero Storage

I accidentally ended up with my pdf attachments both in Zotero Storage and as linked attachments. I want to delete all the attachments from Zotero Storage. There are too many to do one at a time. Is there a way to delete all of them (in bulk)? Thanks.
  • Or, if that's impossible, I'd settle for a method to delete all of the linked files in bulk. But my initial request would be much preferred.

    Thanks in advance!
  • edited 5 days ago
    Are you saying that all your items have two attachments, one stored and one linked ? Or something different ? And how did that happen ?
  • Hi Tim820,

    Yes. Most of my items have two identical attachments, one stored and one linked. I don't know for sure how it happened as I was importing my library from Paperpile and moving attachments with Zotmoov.

    Any ideas?
  • I can't think of a way of getting Zotero itself to select just stored or just linked attachments, and then deleting only the selected attachments. Maybe the devs have one ?

    One thing that might work to delete just the linked files would involve first moving your linked-files folder to another path. That would effectively break links to linked files in Zotero.

    Then, the latest version of the attachment scanner plugin (v0.4.0) has the ability to remove missing attachments. Give it a try on a small batch of linked attachments first - move them from their path as above, and then run the scanner. You can first get it to just tag the items with missing (linked) attachments, to see if it finds them. If so, you could then let it remove the entries corresponding to those attachments.
    https://github.com/SciImage/zotero-attachment-scanner/releases/tag/v0.4.0

    There might be more complicated ways to do something similar with stored files instead, but I'm not willing to advocate that.
  • This should work, but before proceeding, make a backup of your Zotero "storage" folder to avoid accidental data loss.

    1) Make a copy of the "Zotero/storage" folder
    2) Use File Explorer (Windows) or Finder (macOS) to search for all .pdf files within the storage folder.
    3) Select and delete these files.
    4) Use Zotero Attachment Scanner to remove missing attachments.

    As tim820 suggested, try it with a few files first.
  • Thank you both! I'll try that! :)
  • Yep, worked like a charm! That saved me hours of work. Thanks so much!
Sign In or Register to comment.